Exclude subfolder from WP-redirect works with html but not php files

I want a certain subfolder excluded from being handled by WP with its 404 – page not found message.

My problem is:

  • example.com/Non_WP/myfile.htmlshows correctly

but

  • example.com/Non_WP/myfile.php – will trigger a WP 404-page not found message.

Both files, myfile.html and myfile.php exist in the Non_WP folder.

My .htaccess file looks like this:

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

It should exclude WP from handling the “Non_WP” folder.

WP is installed in the root folder and there are no redirect-plugins active.

Any idea what I’m doing wrong? Any idea where to locate the problem other than the .htaccess file?

2 Answers
2

Well localized the problem (without understanding it so far)

It was not the .htaccess file.

It was not plugins or themes (which I deactivated all to see what happens)

But my little php app had their own session handling and modified the header. Just simple textbook stuff (login etc..) which works flawless outside WP.

I didn’t analyse why this happens, but without the session/header stuff my php app works fine alongside WP.

Leave a Comment