403 error

Discussion in 'Apache' started by alisamii, Nov 21, 2010.

  1. #1
    Hi:

    As of yesterday, for some reason, I am getting a 403 error on my web server when trying to access the xml sitemap for my site.

    I haven't made any changes that could cause that, and was hoping there might be someone here who would be willing to take a look under the hood and help me figure out what may be causing the error. It is rather important.

    If someone is willing to help, I will provide you the necessary ftp and/or cpanel access.

    Thanks,

    Ali
     
    alisamii, Nov 21, 2010 IP
  2. alisamii

    alisamii Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Well, I think I have found the culprit, but not sure how to solve it.

    In my .htaccess file, I have the following files directive.


    
    ## Deny access to extension xml files (uncomment out to activate)
    <Files ~ "\.xml$">
    Order allow,deny
    Deny from all
    Satisfy all
    </Files>
    ## End of deny access to extension xml files
    
    Code (markup):
    Naturally, that is blocking ALL xml files.

    I would like to over-ride that for a couple of specific files. All these files are in the root level or I have specific URLs for them.

    The files I would like to allow access to are:

    http:// mydomain . com //sitemap.xml
    http:// mydomain . com /index.php?option=com_xmap&sitemap=3&view=xml
    http:// mydomain . com /BingSiteAuth.xml

    How do I deny all xml and allos these three files?

    Thank you
     
    alisamii, Nov 21, 2010 IP
  3. joebert

    joebert Well-Known Member

    Messages:
    2,150
    Likes Received:
    88
    Best Answers:
    0
    Trophy Points:
    145
    #3
    Change the ORDER directive to "deny,allow" so that ALLOW directives can override the global DENY directive.
    Add a FILESMATCH container after your current FILES container, this should match your exception filenames.
    Include a SATISFY directive within your new FILESMATCH container and set the value of SATISFY to ANY.
    Add an ALLOW directive within the new container witha value of "from all"
     
    joebert, Nov 21, 2010 IP
  4. alisamii

    alisamii Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I'm sorry, I understand what you suggest, but not sure how to write the code you suggested. Would this be correct?

    
    ## Deny access to extension xml files (uncomment out to activate)
    <Files ~ "\.xml$">
    Order deny,allow
    Deny from all
    Satisfy all
    </Files>
    ## End of deny access to extension xml files
    
    ## Allow access to specific xml files
    <Filesmatch "http\:\/\/mydomain\.com\/\/sitemap\.xml">
    Allow from all
    Satisfy all
    </Filesmatch>
    ## End of allow access to specific xml files
    
    Code (markup):
    If not, could you please white a FILESMATCH container for me which would do the trick?

    Also, is there a way to include the three files in one container, or would I need to have a separate container for each?

    Thanks
     
    alisamii, Nov 22, 2010 IP
  5. joebert

    joebert Well-Known Member

    Messages:
    2,150
    Likes Received:
    88
    Best Answers:
    0
    Trophy Points:
    145
    #5
    joebert, Nov 22, 2010 IP
  6. alisamii

    alisamii Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Well, I added that to my .htaccess and that's all great, except Google webmaster still reports that it cannot access the sitemap.

    I wonder if anyone can take a closer look for me.

    Something is blocking access to the sitemap and it isn't the xml deny directives.

    I just cannot figure out what.

    It was working, and then as of a couple days ago, it no longer worked. The deny directive was in place before when it worked, without the sitemap exclusion.

    Anyone who is willing to help, please let me know and I will give you access to my server, cms installation (Joomla) or whatever else you need.

    Thanks.
     
    alisamii, Nov 22, 2010 IP