ErrorDocument 403 causes infinite loop

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

  1. multiverse

    multiverse New Member

    Hello,

    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:

    Code:
    # China
    deny from 1.12.0.0/14
    deny from 1.24.0.0/13
    deny from 1.45.0.0/16
    deny from 1.48.0.0/15
    At the end of my .htaccess file those that are redirected with a 403 get a custom 403:

    Code:
    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