I am running the qtranslate plugin on my application and I am using get_site_url() for it's various functionalities. below I have two blocks of code. The first one I use get_site_url to view a file that was saved in "/wp-content/themes/seowp/essay_upload/" and it doesn't redirect to http://example.com/es/ however in the second one it does, thus returning a 404 error. These two blocks of code are on the same file.
<?php $file_read = get_site_url()."/wp-content/themes/seowp/essay_upload/".$student_row->attach_essay; ?>
<a href="<?php echo get_site_url();?>/essay-edit/?regNoIndivid=<?php echo $student_row->id;?>&type=artist">Bearbeiten</a> |
<a href="<?php echo $file_read;?>">Text to download essay in another language</a>
**This second block of code is used to create a certificate on the fly when clicked using certificat_pdf.php. It is not working correctly like the code above. It even shows the correct URL when I mouseover the link but when I click on it, it redirects to http://example.com/es/certificat_pdf.php?regNoCerts=A00094094 (/es/) being the language specific page and naturally I get a 404 error.Everything works perfectly in english. The only issue is when I view it in a different language. **
<a href="<?php echo get_site_url()."/";?>certificat_pdf.php?
regNoCerts=<?php echo $_REQUEST['regNumber'];?>">Foreign language text</a>