I have a Wordpress based site with an additional custom PHP application with files in it's own folders - "staff", "volunteers" etc. We have mod-rewrite in .htaccess file so we can use permalinks
# 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>
I have a specific page in the "staff" folder, "form.php" that is giving me trouble - specifically, after Apache/PHP upgrade apostrophes in the POST variables seems to cause an issue - BUT instead of a PHP or SQL error I get Wordpress 404 page. How do I change that so I can start troubleshooting? I can not disable permalinks, the site is live.
RewriteEngine Off
in .htaccess in "staff" folder does not do anything.
The first image shows what happens if the form textarea variable had an apostrophe plus space, the second shows that an apostrophe by itself does not cause a problem.
Thank you!
UPDATE: I got it down to a specific combination of letters, spaces and apostrophe
always rembember to 'select'
- gives a consistent 404 error
always remember to 'salut'
- does not
so I think it's reserved query words(?) in combination with apostrophe that is causing the issue and if I manage to keep Wordpress out of this folder, we would not be having any issues!
UPDATE 2: the issue turned out to be a general Apache error - issues with mod-sec. However, instead of generating 403 forbidden that would be easier to troubleshoot, 404 page complicated the troubleshooting process.
/var/log/apache2/error.log
or/usr/local/apache/logs/error_log
. Most hosting providers will provide a means to access the error log through a web-interface.