↧
Answer by Madan Sapkota for Block access to sitemap.php but allow sitemap.xml
When the request is sent to a sitemap PHP file, redirect to the XML file.RedirectMatch 301 ^sitemap.php$ sitemap.xml
View ArticleAnswer by Robbert van den Bogerd for Block access to sitemap.php but allow...
Does this work?RewriteEngine onRewriteRule ^sitemap\.php$ /sitemap.xml [R,L]RewriteRule ^sitemap\.xml$ sitemap.php [NC,END]It blocks the file from being visited and sends a 403 forbidden to the client....
View ArticleBlock access to sitemap.php but allow sitemap.xml
I have a sitemap.php file in the news folder, where I dynamically create a sitemap based on the entries which I have in my database. I also have the following .htaccess file:RewriteOptions...
View Article