PDA

View Full Version : If someone can help,



Hollie
03-27-2005, 01:35 AM
I suppose it's a javascript.
Of my website, I have some pages that were deleted. But people keep gping to those wrong urls.
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.
I would like to do that.
Does somebody knows how?

I'd appreciate if someone can help!

jscheuer1
03-27-2005, 07:32 AM
Well, the way you are describing it, this is your page, give it the same name and put it in the same location as the missing page(s) had. You can use as many copies as you need:


<html>
<head>
<title>Lost?</title>
</head>
<body>
<p>You must be lost, follow this <a href="url of the page you want goes here">link</a> home.</p>
</body>
</html>Replace the red stuff above with the address you want them to go to, like:

http://www.myserver.com/index.htm

use an actual address to the page you want.

mwinter
03-27-2005, 12:54 PM
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):


ErrorDocument 404 /404.htmlThis 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),


Redirect permanent /old-address http://www.example.com/new-addresswould cause any requests "below" /old-address to be sent to /new-address.

Mike