
Originally Posted by
Hollie
I suppose it's a javascript.
No, it isn't.
I've seen some website, that when that happens they make a page that say you got lost, and they put the link to the main place.
When a server is asked to serve something that doesn't exist, it returns a status code. In this case, the code is 404. If that's all that happens, you'll see a generic error message. However, you can order the server to send a particular document instead. How you do that depends on the server software your host uses, and if they allow you to specify your own error documents.
On Apache servers, you can place an ErrorDocument directive in a .htaccess file (the dot in that filename is not a typo):
Code:
ErrorDocument 404 /404.html
This line would instruct the server to send the http://www.example.com/404.html file. The file could also be dynamic, like a PHP or JSP script which could perform some task, or create special output depending on the originally requested file.
If you've moved files, you can also use server-side redirects to send the visitor to the new address automatically. For example (again, Apache),
Code:
Redirect permanent /old-address http://www.example.com/new-address
would cause any requests "below" /old-address to be sent to /new-address.
Mike
Bookmarks