AFAIK by default all .htaccess files in all directories leading to the file requested are parsed, i.e. in this setup:
DOC_ROOT = /usr/local/www/dataAllowOverrideis set toAllin the above directory
if a file at /dir1/dir2/dir3/file is requested, all folders from / down are being checked for .htaccess. If the file is found it is parsed and then the execution is continued based on combined contents of the .htaccess files.
So here’s my setup:
DOC_ROOT = /usr/local/www/data– that’s where all static and php files are kept.- there’s a
.htaccessin theDOC_ROOTthat rewrites all but some requests to index.php. - there’s a
/Python/root.wsgiin theDOC_ROOTand in httpd.conf there’s this:WSGIScriptAlias /apps /usr/local/www/data/Python/root.wsgi
As you can imagine I do not want .htaccess to be used at all for the /Python folder, but it is. How do I prevent it?
I tried setting this in httpd.conf, but it doesn’t do the job:
<Directory "/usr/local/www/apache22/data/Python">
AllowOverride None
</Directory>
If I do put .htaccess in the Python folder with RewriteEngine off that seem to do the job, but I don’t want to be forced to put such a file in each of the subfolders I don’t want to root .htaccess to be used.
There isn’t a way to disable inheritance, sadly. An easier way could be to create a single folder in your web root for “everything else”, and in the .htaccess in there, put the
RewriteEngine offstatement.I think you can do something with
RewriteCondto disable this. If you want all subfolders to just be accessible (and rewrite anything that doesn’t match an existing subfolder), you can useRewriteCond !-d.