It seems that Wordpress has changed the default .htaccess
file so that you can no longer run different PHP code within the a subfolder. It also states that the block in the .htaccess
file is dynamically created, so messing with it directly would be problematic.
So what is the correct way to support running other PHP code that isn't related to Wordpress in a subfolder that Wordpress is installed?
# BEGIN WordPress
# The directives (lines) between "BEGIN WordPress" and "END WordPress" are
# dynamically generated, and should only be modified via WordPress filters.
# Any changes to the directives between these markers will be overwritten.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
.htaccess
file so that you can no longer run different PHP code within the same folder." At least for me, this doesn't seem to be the case. For example, I can have afoo.php
in the folder next to the.htaccess
and navigate to it via/foo.php
and it will run.foo.php
in some arbitrary subfolder and navigate to it via/some/arbitrary/folder/foo.php
and it will run.