PDA

View Full Version : How do i detect a "Page not found error"?


potdl
05-12-2003, 12:49 PM
I dont want to get the page not found error, i want to redirect people to another page or back to my home page if the page could not be displayed.

I`m opening files in my page and if the file is`nt there then i want to display a message and let the user know. the file number is wrong, and not let him get the page not found error.

Thanks
Derick:rolleyes: :rolleyes:

brothercake
05-12-2003, 12:52 PM
Not in javascript - you'd need a server-side process to redirect based on 404 error code - but javascript can't do this.

But it sounds more like what you want is a custom 404 page - so that errors are dealt with nicely instead of one of those unfriendly white techy pages.

If you have a paid hosting package, then you almost certainly can setup your own 404 page. If you're on a free host then you're probably out of luck - ad-strewn 404 pages are one of the ways free hosts make their money.