Go Back   CodingForums.com > :: Server side development > Apache configuration

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-08-2004, 07:12 AM   PM User | #1
Raraken
Regular Coder

 
Join Date: Jan 2004
Posts: 107
Thanks: 0
Thanked 0 Times in 0 Posts
Raraken is an unknown quantity at this point
htaccess - custom error pages

How would I program an htaccess file to jump to an error page, whenever users access a non-existant document?
Raraken is offline   Reply With Quote
Old 08-08-2004, 07:58 PM   PM User | #2
anarchy3200
Regular Coder

 
anarchy3200's Avatar
 
Join Date: Mar 2003
Location: England
Posts: 261
Thanks: 0
Thanked 1 Time in 1 Post
anarchy3200 is an unknown quantity at this point
There is a good tutorial at:

http://javascriptkit.com/howto/htaccess2.shtml

You would create something like:

ErrorDocument 400 /errors/badrequest.html
ErrorDocument 401 /errors/authreqd.html
ErrorDocument 403 /errors/forbid.html
ErrorDocument 404 /errors/notfound.html
ErrorDocument 500 /errors/serverr.html

as your htaccess file and when you get the specific error it sends you to the link e.g.
a 400 error would send you to the page /errors/badrequest.html
__________________
Mike
anarchy3200 is offline   Reply With Quote
Old 08-09-2004, 02:00 AM   PM User | #3
Raraken
Regular Coder

 
Join Date: Jan 2004
Posts: 107
Thanks: 0
Thanked 0 Times in 0 Posts
Raraken is an unknown quantity at this point
I've read that site word by word, and whenever I try adding ANY content to the access doc, it says "internal server error"
Raraken is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:19 AM.


Advertisement
Log in to turn off these ads.