Windows server, running Apache. In my Apache conf, I have AllowOverride None
for the root of a site and then I have a subdirectory set to AllowOverride All
:
<Directory />
AllowOverride None
</Directory>
<Directory "/safe/">
AllowOverride All
</Directory>
However, when I try to set up a rewrite rule in the subdirectory's .htaccess
file, nothing happens, I just get a 404 page not found error. Example:
RewriteEngine On
RewriteRule (.*) /blah?test=$1 [R=302,NC,NE,L]
Rewriting URLs are working fine from the root via the Apache conf. I don't understand why the rule is ignored. I don't want to do the URL re-writing within the conf because for this case I may need to be changing the redirects constantly and don't want to reload the server every time a change is made. I also don't want to affect server performance by enabling .htaccess
files site-wide, just in the subdirectory I need it.