开发者

Does mod_rewrite in subdirectories' .htaccess override higher levels?

I'm using mod_rewrite to map my old directory structure to a new one. I have the following rule in my top-level .htaccess file, and it works:

RewriteEngine On
RewriteCond %{REQUEST_URI} /blog/archives/(.*)
RewriteRule ^.*$ /archives/%1 [L,R=301]

As you can guess, this takes http://example.com/blog/archives/00001.php and redirects it to http://example.com/archives/00001.php.

But when I add these rewrite rules to the .htaccess file in the /blog directory

RewriteEngine on
RewriteRule atom.xml$ /atom.xml [L,R=301]

the top-level redirect no longer works. If I move the rule in the /blog .htaccess file to t开发者_Go百科he top-levle file both rules work. Can someone explain what is happening here?


Check the inherit flag of the RewriteOptions directive here.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜