htaccess exception for selectively un/blocking xml

Discussion in 'Apache' started by Lever, Dec 3, 2009.

  1. #1
    I've been given a snippet of code for my .htaccess that blocks direct access to XML files.

    <Files ~ "\.xml$">
    Order allow,deny
    Deny from all
    Satisfy all
    </Files>
    Code (markup):
    Whilst this helps prevent direct access to all XML files it also stops Google from accessing my sitemap XML files which is a bit of a problem as I use both a generic sitemap.xml file and a news.xml file.

    Is there a way to block access to all XML files and yet allow an exception for the xml sitemaps and any other particular files that I specify?

    Many kind thanks in advance :)
     
    Lever, Dec 3, 2009 IP