Nathalie
09-17-2005, 09:45 AM
Hello,
Well till now I have always used a redirection for the 404 page to the index page using a javascript but from what I heard it's now forbidden, no more javascript to redirect pages so what can I do ? I mean, is there a google "friendly" way to do do ? Because redirect a 404 page is NOT spam.
Thx !
Nathalie.
softplus
09-17-2005, 11:07 AM
Make sure your 404 page really returns 404 and stays that way (check out http://gsitecrawler.com/articles/error-404-200.asp and http://gsitecrawler.com/tools/server-status.aspx ). But you've probably got that part ;-)
As to the contents of the 404 page, there are several possibilities:
a) if you really want to return the user to the "/" page, you can have the error handler server.transfer to it (on asp.net) or have the error handler read it and pass it to the user (elsewhere). Note that this won't count as duplicate content as long as the page returns 404, the spiders won't read the contents of the page itself.
b) have the index-page set up as the default 404 handler. In the page (php/asp/etc code), have it check the URL that was called. If it isn't a valid URL for that page, set the result code to 404, but display the page normally. This is virtually the same as a) and the spiders won't mind as long as you're returning 404.
c) If you want to try your luck, you can either hide the javascript redirects (lots of ways, from simple to complicated) -- also, it has been mentioned that Google doesn't mind redirects that happen after some time, i.e. don't use 0 seconds, use something like 15-30 seconds (displaying a message that the URL isn't available, I'll get you to the home page in a sec...)
d) Don't redirect to your home page, set up a custom handler depending on the URL the user wanted. If you can, try to guess what he wants and offer a list of possibilities. Or otherwise, display a small html sitemap of your site and let the user go to whereever he wanted in the first place (or let him discover something new :-)).
Hope it helps!
Nathalie
09-17-2005, 12:45 PM
well well a bit complicated for me :confused: I am not a developper but I think your last option is the best (a little site map within the 404).
BTW, a spider does not read a 404 ?
As far as javascript is concerned I was using that one for the 404...(hmmm not sure I can show it to u in the forum) with an htaccess : ErrorDocument 404 /404.html.
Danke for your answer earlier :)
Nat.