开发者

How to redirect to sitemap.php from htaccess

I am using htaccess coppied from wordpress.

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule . index.php [L]

It works fine开发者_如何学运维.

I would like to add a script to redirect to sitemap.php file if user requests sitemap.xml.

I tried adding RewriteCond %{REQUEST_FILENAME} !-^sitemap.xml$ but didn't work.


Put the rule BEFORE that set of rules:

RewriteRule sitemap\.xml sitemap.php [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜