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

schwim

Well-Known Member
Aug 2, 2006
213
0
166
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
 

krava

Well-Known Member
Sep 23, 2003
149
0
166
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 ?
 

schwim

Well-Known Member
Aug 2, 2006
213
0
166
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
 

WEB-PROS

Well-Known Member
Feb 19, 2006
111
0
166
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.
 

schwim

Well-Known Member
Aug 2, 2006
213
0
166
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
 

schwim

Well-Known Member
Aug 2, 2006
213
0
166
Got it:

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