我对mod_rewrite规则没什么问题。该规则似乎正在工作,但阻止对目录及其文件的访问。Mod_Rewrite隐藏目录
这里是我想要完成
www.example.com/about-us/ *** Parent rule
www.example.com/about-us/our-mission.html *** child rule
虽然,我的规则是实现这一点,但阻止访问物理文件和目录服务器上。
在同一台服务器,我有管理界面,用户需要访问作出改变......
www.example.com/manage/dash.php
当我尝试访问目录/管理或它的是文件,我重定向到404页这是由子重写规则生成的重定向。
当我注释掉孩子重写规则时,我能够访问这些提到但带有子规则的访问被阻止。
请参阅下面的我的重写代码,并帮助我确定问题。
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
#This rule will rewrite url to the main page www.example.com/about-us
RewriteRule ^([^/]+)/?$ index.php?get_parent=$1 [L]
#This rule will rewrite url to the secondary url www.example.com/abou-us/our-mission.html
RewriteRule ^([^/]+)/([^/]+)/?$ index.php?get_parent=$1&get_child=$2 [L]
谢谢。
我明白了,所以这确实解决了这个问题,一旦规则结束,第一组排除便会被排除。没有想过这样。 – S01010011