如何防止 get_site_url() 重定向到特定语言的页面?

How can I keep get_site_url() from redirecting to the language specific page?

我是 运行 我的应用程序中的 qtranslate 插件,我正在使用 get_site_url() 来获得它的各种功能。下面我有两个代码块。第一个我使用 get_site_url 查看保存在“/wp-content/themes/seowp/essay_upload/”中的文件,它不会重定向到 http://example.com/es/ 但是在第二个中它会重定向,因此返回 404错误。这两个代码块在同一个文件中。

     <?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> &nbsp;|&nbsp; 
      <a href="<?php echo $file_read;?>">Text to download essay in another language</a> 

**第二个代码块用于在使用 certificat_pdf.php 单击时即时创建证书。它不像上面的代码那样正常工作。当我将鼠标悬停在 link 上时,它甚至显示正确的 URL 但是当我点击它时,它会重定向到 http://example.com/es/certificat_pdf.php?regNoCerts=A00094094 (/es/) 作为特定语言的页面,自然我会得到 404 error.Everything 英文版完美无缺。唯一的问题是当我用不同的语言查看它时。 **

        <a href="<?php echo get_site_url()."/";?>certificat_pdf.php?
    regNoCerts=<?php echo $_REQUEST['regNumber'];?>">Foreign language text</a>

qTranslate 正在做它应该做的事情,并且正在更改它认为是正常页面的 URL 以便显示翻译版本。第一个示例未翻译,因为它不是您网站上的页面。

我建议在您的网站上创建一个页面并将 certificat_pdf.php 文件更改为您主题中的 page template。这样一来,页面 URL 被翻译并不重要,因为该页面仍会被找到。