0
我有一个Zend应用程序使用hatccess并将所有内容重定向到index.php,但现在我需要在其中一个子文件夹中使用密码保护文件夹,但是当我尝试访问子文件夹时给我404错误。父htaccess覆盖子文件夹htaccess
这里了Zend的htaccess中的public_html文件夹:
RewriteEngine On RewriteRule !\.(js|txt|ico|gif|GIF|jpg|JPG|png|PNG|css|swf|pdf|xml|XML|eot|svg|ttf|woff)$ index.php SetEnv APPLICATION_ENV "production"
这里的子文件夹中的htaccess:
RewriteEngine off AuthType Basic AuthName "*folder*" AuthUserFile "/home/*user*/.htpasswds/public_html/*folder*/passwd" require valid-user
我尝试添加RewriteRule ^blog/ - [L]
到的public_html文件夹我看到: Overwrite rewrite-rule of htaccess in parent folder
但它没有奏效。奇怪的是,如果我把子文件夹htaccess的密码部分,“rewriteEngine off”工作,我得到了该文件夹中的文件列表。
观测值:服务器是Apache的2.2.25,所以rewriteOptions InheritBefore不是一个选项
OBS2:在文件夹和用户不是那样的实际htaccess的那只是隐藏名。
Obs3:即时通讯服务器配置中的noob
它没有工作:( 即时通讯开始认为服务器有一些配置,我不知道下面。 – gmlv
我不知道你的应用程序运行在什么样的服务器。但是这可能是一个覆盖问题。当你使用apache与vhosts。可以设置AllowOverride All。参见:http://httpd.apache.org/docs/current/mod/core.html#allowoverride –
Ow你的服务器版本列在问题中,对不起,我可以检查AllowOverride是否设置为全部,如果没有,设置为全部并重新启动Apache: –