Web Hosting Talk







View Full Version : How to create a custom 404 error page for a virtual?


oliverm
07-24-2002, 02:00 PM
I have tried uploading a .htaccess file on the server but it gives me an error when going to the site. And I have to deleted and set it up as a new virtual.

Any suggestions??

babak
07-24-2002, 02:04 PM
Hi

Which raq?

You have to edit your httpd.conf.

Regards,
Babak

oliverm
07-24-2002, 02:05 PM
Raq 4

babak
07-24-2002, 02:12 PM
Hi

sorry you dont have to edit httpd.conf, but edit srm.conf.

SSH login
su
cd /etc/httpd/conf
pico srm.conf


scroll down and you see this lines:


# Customizable error response (Apache style)
# these come in three flavors
#
# 1) plain text
#ErrorDocument 500 "The server made a boo boo.
# n.b. the (") marks it as text, it does not get output
#
# 2) local redirects
#ErrorDocument 404 /missing.html
# to redirect to local url /missing.html
#ErrorDocument 404 /cgi-bin/missing_handler.pl
# n.b. can redirect to a script or a document using server-side-includes.
#
# 3) external redirects
#ErrorDocument 402 http://some.other_server.com/subscription_info.html
#

ErrorDocument 401 /cobalt_error/authorizationRequired.html
ErrorDocument 403 /cobalt_error/forbidden.html
ErrorDocument 404 /404.htm
ErrorDocument 500 /cobalt_error/internalServerError.html




now put a error-page in /web of each VS called 404.htm

P.S: Restart the apache.


That's it.

Regards,
Babak

CmptrWz
07-24-2002, 07:33 PM
Take note, if you have .htaccess files activated you can stick the ErrorDocument statements in an .htaccess file instead. Then the user of the site can edit them if the paths change for some reason.

oliverm
07-25-2002, 10:31 PM
Thanks "babak"

I took me three months and many posts in other forums to get the answer.

It took 5 minutes by following your steps and problem solved. :)

babak
07-26-2002, 03:37 AM
Your welcom.

Iám glade that I could helped you.

Regards,
Babak