htaccess限制覆盖?

有没有办法来覆盖子目录中的htaccess文件? 过去几个小时一直在Google上search,没有什么用处。

我想阻止一些IP和不需要的机器人,但是我的403页面是在一个子目录中的,所以我必须重写Deny的内容,但从Allow from all似乎并没有撤销Deny的。 这是我一直在尝试的代码:

/public_html/.htaccess

 <Limit GET POST> Order Allow, Deny Allow from all Deny from 111.13.8.* </LIMIT> <Files "/errors/"> Order Allow, Deny Allow from all </Files> 

它返回一个500错误。 由于机器人无法访问errors子目录的htacess文件,这个代码将不得不在这里。

我想你想要

 <Files "/errors/*"> 

代替

 <Files "/errors/"> 

你可以缩小你的.htaccess

 <Limit GET POST> Deny from 111.13.8.* </LIMIT> 

你可以在每个subdir中有.htaccess ,所以你可以在subdir errors做:

 <Limit GET> Allow from * </LIMIT> 

有关Files指令的用法,请参阅http://www.askapache.com/htaccess/using-filesmatch-and-files-in-htaccess.html

所有这一切都假设你可以在你的public_html目录中覆盖指令。