开发者

Stop Parent .htaccess file from Propagating to Child Directories

I've got a .htaccess file in the web root directory of the server that has a line like:

Redirect 301 /index.php http://my-new-site.com

I've discovered that all index.php files in sub-directories respect that redirect too. Okay... I didn't know that .htaccess files in parent directories propagated t开发者_C百科hough to their children. Good to know. But is there any way to stop that behavior? Can I restrict the .htaccess file to only affect files in the same directory?

Basically, how do I stop .htaccess rules from propagating to child directories?


I just tested it, and it doesn't work this way for me. Are you sure you're not using RedirectMatch which (with those values) would just match /index.php anywhere in the request string. What does the rest of the .htaccess look like? Are there .htaccesses in any of the affected directories? What do they look like?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜