Why can't I disable .htaccess in Apache?

This is the opposite problem of most of which I read. I am running Ubuntu 8.04 on an Amazon instance with Apache 2.2.8, and I cannot understand why setting AllowOverride to None for root does not stop my .htaccess file.

I have a subdirectory with hello.py in it and a .htaccess file. When I view the file, it works great with modpython serving the file. If I put the garbage in .htaccess, I get a server error, so I know that the .htaccess file is being used. Also, if I delete the .htaccess file, hello.py is no longer a modpython server - instead, the browser tries to open it.

In one of my available sites (related sites) I have "AllowOverride None" for the root directory. I thought this would prevent the inclusion of .htaccess from the root and all its subdirectories, which should cause hello.py not to be served by mod_python. However, it is still well-served, and I can verify that .htaccess is still enabled, because when I change it, I see the results in my browser.

Perhaps there is something that I do not understand about my file in the permitted sites. This is the file I'm using:

NameVirtualHost *:8080 
<VirtualHost *:8080>
<Directory />
AllowOverride None
</Directory>
</VirtualHost>

Thanks for any help.

+5
source share
2 answers

, mod_python .htaccess - , mod_python. , .htaccess, .

, , .htacess , . , AllowOverride None . , - ? , , , .

+3

AllowOverride <Directory>, .

, , , (sub -) <Directory> - AllowOverride , None. .

<Directory />
    Options FollowSymLinks
    AllowOverride None
</Directory>
<Directory /var/www/>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride AuthConfig 
    Order allow,deny
    allow from all
</Directory>

/var/www ( docroot) .htaccess es.

, mod_python , .htaccess, , mod_python .htaccess.

, .

PS: , , , AllowOverride - None <Directory />.

+2

All Articles