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


  • 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]
# 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?

, , Raphael 5 months 0 Answers 48 views 0

Leave an answer