The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

My custom 403 pages don't work, because the connection is refused ;)

Discussion in 'General Discussion' started by schwim, Nov 17, 2006.

  1. schwim

    schwim Well-Known Member

    Joined:
    Aug 2, 2006
    Messages:
    198
    Likes Received:
    0
    Trophy Points:
    16
    Hi there guys,

    I'm getting bagged by referral spam, and I'm taking escalating measures via .htaccess to protect the site, but as always happens, a couple people get caught in the cross fire. No problem, right? Just create a custom 403 file and help them get back to the site.

    Only problem is that the custom 403 page will not show. It's just the default(can't find it) message. I've also created a 404 page which views just fine, so this leads me to believe that the 403 file isn't getting served because of the refused connection.

    Can someone help me get a 403 file working?

    thanks,
    json
     
  2. krava

    krava Well-Known Member

    Joined:
    Sep 23, 2003
    Messages:
    149
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    Hello.

    Did you add the line like:

    ErrorDocument 403 /403.html

    in .htaccess of your account ? If so, does 403.html exist in root of public_html ?
     
  3. schwim

    schwim Well-Known Member

    Joined:
    Aug 2, 2006
    Messages:
    198
    Likes Received:
    0
    Trophy Points:
    16
    Hi there and thanks for the reply,

    I did add that in the .htaccess and the 403 error page is in the root. If I purposefully block myself, it shows the default error, however if I remove the .htaccess file and refresh the page, it properly shows my custom 403 page. It's blocking me from getting the 403 page.

    thanks,
    json
     
  4. WEB-PROS

    WEB-PROS Well-Known Member

    Joined:
    Feb 19, 2006
    Messages:
    111
    Likes Received:
    0
    Trophy Points:
    16
    You need to add a rule to the .htaccess file to allow you to access only that file, otherwise it will just block you from the file.

    If you understand.
     
  5. schwim

    schwim Well-Known Member

    Joined:
    Aug 2, 2006
    Messages:
    198
    Likes Received:
    0
    Trophy Points:
    16
    thanks very much for your reply.

    I can find tons of data on how to block a file, but I can't seem to find anything on how to allow a file. Can anyone paste the proper code to use in .htaccess?

    thanks,
    json
     
  6. schwim

    schwim Well-Known Member

    Joined:
    Aug 2, 2006
    Messages:
    198
    Likes Received:
    0
    Trophy Points:
    16
    Got it:

    Code:
    <Files 403.shtml>
    order deny,allow
    allow from all
    </Files>
    
    thanks,
    json
     
  7. WEB-PROS

    WEB-PROS Well-Known Member

    Joined:
    Feb 19, 2006
    Messages:
    111
    Likes Received:
    0
    Trophy Points:
    16
    Its sometimes just a small hint can make you think :)
     
Loading...

Share This Page