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]
精彩评论