ErrorDocument 403 causes infinite loop

Discussion in 'Server Operation' started by multiverse, Dec 27, 2010.

  1. multiverse

    multiverse New Member


    I am a customer of Dreamhost, and I have created a .htaccess that is filled with "deny from" statements to prevent China and many other countries from accessing my website. Here is an example:

    # China
    deny from
    deny from
    deny from
    deny from
    At the end of my .htaccess file those that are redirected with a 403 get a custom 403:

    ErrorDocument 403 /errordocs/403.html
    I realized later that the loop existed as evidenced by my error.log file:

    How do I grant access to 403.html to IP Addresses I have forced to redirect? How do I break this loop? Currently I redirect them to a friendly search engine, but would prefer to show them a message in case one of the visitors is a non-spammer who would like to access the site in an alternate way.

    Thanks in advance.
    Last edited: Dec 27, 2010

Share This Page