I have a website that uses WordPress (in its own subdirectory) as the main site. Additionally, I have separate websites in their own folders.

For example:

.
-wordpress_site
-other_site
   script.php

In other_site, I am developing a simple PHP application. Here, I’m generating links with querystrings, similar to the following:

<a href="script.php?id=1">1</a>
<a href="script.php?id=2">2</a>

When I access the page directly (i.e., typing the URL with querystring directly into the address bar) it loads fine. However, whenever I click a link, I receive a 500 error that automatically routes to the default WordPress error page.

For reference, here is the .htaccess file in my public_html folder:

 # BEGIN WordPress
 <IfModule mod_rewrite.c>
 RewriteEngine On
 RewriteBase /
 RewriteRule ^index.php$ - [L]
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteRule . /index.php [L]
 </IfModule>
 # END WordPress

What confuses me is that I can type it in directly and it works, but clicking the link does not.

Read more here: Link with QueryString causes 500 error with WordPress and separate application


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


WordPress related questions and answers: