Web Hosting Talk







View Full Version : error pages redirect (shtml)


kgp43
12-27-2004, 11:04 AM
hi,

Does some of you know how to redir a 404.shtml (or other types of those error pages) to another page (like a php)

ex.:

www.mydomain.com/404.shtml
should redir all requests to
www.mydomain2.com/error_pages/404.php

assistanz247
12-27-2004, 11:30 AM
Hi Kgp,

Use the following entries in your ' .htaccess ' file ::

ErrorDocument 400 http://domainname.com/400.shtml
ErrorDocument 401 http://domainname.com/401.shtml
ErrorDocument 403 http://domainname.com/403.shtml
ErrorDocument 404 http://domainname.com/404.shtml
ErrorDocument 500 http://domainname.com/500.shtml

Hope it will help ;)

kgp43
12-27-2004, 03:10 PM
can this be added into httpd.conf aswell?

kgp43
12-27-2004, 03:31 PM
the answer is yes :)

I found this usefull article:
http://www.stormerhosting.net/support/serverhelp/webserver/errorcodes.html

assistanz247
12-28-2004, 09:33 AM
Yep!! Even you can add this in every virtualhosts...;)