Quantcast
Channel: Block access to sitemap.php but allow sitemap.xml - Stack Overflow
Browsing latest articles
Browse All 3 View Live

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 Article



Answer 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 Article

Block 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
Browsing latest articles
Browse All 3 View Live




Latest Images