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

Block access to sitemap.php but allow sitemap.xml

$
0
0

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 InheritBeforeRewriteEngine OnRewriteRule ^sitemap.xml$ sitemap.php [L]

So the link can look like this: domain.com/news/sitemap.xml. It's working, but my question is: How can I block access to the sitemap.php file in .htaccess, so as not to give unnecessary information to others?


Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles





Latest Images