PDA

View Full Version : Customizing "Forbidden = Access denied" error page...


larryb
6-8-02, 08:44 PM
Can I modify the "Forbidden" access denied error page in a similar way to customizing the 404 error page? This page comes up when your ip address is blocked using the .htaccess file. I would like to display an email address in this page just in case I block out the wrong ip addresses

Thanks in advance....

(jj)
6-8-02, 09:51 PM
First off if you have MS Front Page extensions installed, do NOT mess with the .htaccess file. But if you are not using MS FP then you can create an .htaccess file and upload it into your htdocs directory (folder) with the following line(s) for your error docs.

Put in the following line(s) for each error doc you want to customize:

ErrorDocument Code /errorpage.html

"Code" would be:
301 for "Moved Permanently"
304 for "Not Modified"
403 for "Forbidden"
404 for "Not Found"
500 for "Internal Server Error"

The /erropage.html would be the name you give to your custom error document.

for a 404 error doc it would look like this

ErrorDocument 404 /custom404.html (the name can be anything you wish as long as it is a .html)

To create an .htaccess file:

Create a new text document with Notepad and insert the above codes for each custom error page and then save it as htaccess.txt

Upload the htaccess.txt file to your htdocs directory (folder) and after it is uploaded, change the name to .htaccess (note the "dot" in front of the file name).

bettyfordclinic
6-10-02, 06:41 PM
oh dear

I think I just killed my .htaccess file by replacing it with a totally defunct .htaccess file.

Anyone know how to dig my way out of this grave??? help....

Yeah, seriously, this is bad. Everything is unhappy......
I really need the contents of a blank .htaccessfile as soon as possible.

bfc