为什么我不能禁用的.htaccess在Apache的? [英] Why can't I disable .htaccess in Apache?

查看:296
本文介绍了为什么我不能禁用的.htaccess在Apache的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是大多数相反的问题,对此,我已阅读。我在Amazon实例运行Ubuntu 8.04与Apache 2.2.8,我不明白,为什么设置的AllowOverride为无根不被列入停止我的.htaccess文件。

This is the opposite problem from most about which I have read. I am running Ubuntu 8.04 on an Amazon instance with Apache 2.2.8 and I can't figure out why setting AllowOverride to None for root doesn't stop my .htaccess file from being included.

我有一个子目录与hello.py它和.htaccess文件。当我浏览到该文件,它正常工作与modpython提供的文件。如果我把一些垃圾在.htaccess我得到了一个服务器错误,所以我知道正在使用.htaccess文件。另外,如果我删除.htaccess文件,hello.py是modpython不再是服务器 - 而不是浏览器尝试打开它

I have a sub-directory with hello.py in it and an .htaccess file. When I browse to the file, it works fine with modpython serving the file. If I put some garbage in .htaccess I get a server error, so I know the .htaccess file is being used. Also if I delete the .htaccess file, hello.py is no longer server by modpython - instead the browser tries to open it.

在我的网站可用。(在网站功能的链接),我有的AllowOverride无根目录下。我认为,这将prevent的.htaccess被包括来自根及其所有子目录这应该引起hello.py不被mod_python的服务。但是,它仍然提供服务很好,我可以测试的.htaccess仍然被包括在内,因为当我修改它,我看到的结果在我的浏览器。

In one of my sites-available (linked in sites-enabled), I have "AllowOverride None" for the root directory. I thought that this would prevent .htaccess from being included from root and all its sub-directories which should cause hello.py to not be served by mod_python. However, it continues to be served fine and I can test that .htaccess is still being included because when I modify it, I see the results in my browser.

也许有一些东西我不理解我的文件在网站功能。这是我使用的文件:

Maybe there is something I am not understanding about my file in sites-enabled. This is the file I am using:

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

感谢您的帮助。

Thanks for any help.

推荐答案

该文件没有通过,当你删除的.htaccess是因为安装了mod_python的位于它的mod_python所服务的原因。如果移动的东西您的网站,提供文件,可以删除的.htaccess,熟视无睹的问题,并收工。

The reason the file is not served via mod_python when you delete .htaccess is because the setup for mod_python is located in it. If you move that stuff to your sites-available file, you can delete .htaccess, turn a blind eye to the problem, and call it a day.

如果不令你满意,那么为什么.htacess正在读取的一切,我不能说。你是正确的设置AllowOverride无的的prevent了从文件中不断被读取。你有没有认为你添加虚拟网站时搞砸了事情的可能性?试着扔一些垃圾进入配置,看看它是否抱怨,只是要确保它被读取的。

If that doesn't satisfy you, then as to why .htacess is being read at all, I can't say. You are correct that AllowOverride None should prevent the file from ever being read. Have you considered the possibility that you screwed something up when adding the virtual site? Try throwing some garbage into the config and see if it complains, just to be sure it's being read at all.

这篇关于为什么我不能禁用的.htaccess在Apache的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆