Click to See Complete Forum and Search --> : default page instead of http 404
web-eagle
04-16-2003, 04:14 PM
Ok, maybe I should know this already, but it’s never come up before. How can I cause a “default” page of my choice to be displayed (instead of HTTP 404) when a user to my site enters an invalid address. I’ve already tried default.htm and that doesn’t do it.
For example, say www.tld.com/work.htm, www.tld.com/play.htm, and www.tld.com/sleep.htm all exist. But if a user types in www.tld.com/picknose.htm or www.tld.com/scratchhead.htm, I want them routed to www.tld.com/somethingelse.htm.
Anyone know how to do this?
jpmoriarty
04-16-2003, 04:21 PM
usually most hosters have some sort of control panel that will let you change it, but it will either be an IIS setting (is it's a M$ host) or i think it's in the .htaccess file if it's an apache server - saying that it might be in httpd.conf
web-eagle
04-17-2003, 12:18 AM
Thanks, that sounds right.
It is an Apache server, and I’ve changed passwords and MIME types in the .htaccess file before. I just can’t think how to do this, and I haven't found anything on the web.
My host’s 1-800 help line was closed for the day, by the time I got back here, and their 24hr support request form isn’t working for some reason. So I guess I’ll call them first thing in the morning.
<hint>…..unless somebody here can give me an idea…..</hint>
jpmoriarty
04-17-2003, 03:33 AM
i think it's something incredibly simple like:
ErrorDocument 404 /dir/error404.html
in the .htaccess file
AdamGundry
04-17-2003, 04:30 AM
Yes, you need to use the ErrorDocument directive. Check out the Apache manual for more information:
http://httpd.apache.org/docs/mod/core.html#errordocument
Adam
web-eagle
04-17-2003, 01:24 PM
Yes, that was it exactly!!!
ErrorDocument 404 http://tld.com/default.htm
Thanks Guys!
And thanks for the link, Adam. That's goona come REAL handy in the future!
Web-eagle make happy face now