Quantcast
Channel: Block access to sitemap.php but allow sitemap.xml - Stack Overflow
Viewing all articles
Browse latest Browse all 3

Answer by Robbert van den Bogerd for Block access to sitemap.php but allow sitemap.xml

$
0
0

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. I am not 100% sure if it works with the other rewriterule, but just try it and let me know.


Viewing all articles
Browse latest Browse all 3

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>