Forum Moderators: open
Yes, Google and other bots will crawl the original page. They will not parse the javascript and discover that you mean them to look elsewhere. To keep this page out of the index you can use a meta tag like this:
<meta name="robots" content="NOINDEX,FOLLOW">
...but don't assume that the new destination will be found if the link only exists inside the Javascript. It "might" be, but then again, it might not. Have another straight forward HTML link right to that page.
And if you can find a way that serves your purpose without using a javascript redirect, that's the ideal.
And if you can find a way that serves your purpose without using a javascript redirect, that's the ideal.
Aha! Finally figured out the quote thing. :)
I use javascript redirect where I find an old link in serps for a page that would return a 404. I create a new page with that name, give it some redirect code with a 3 second delay and call it good. I make this new page from a current template that has all my page links, so this redirect is nothing more than a way to lower my 404's.
Is there a better way?
>> googlebot comes to my site every two days
That's because you change your site a lot. Googlebot will come often to catch up with your changes, see this thread: Getting Fresh [webmasterworld.com]
grandpa:
>> Is there a better way?
Yes, definitely. You don't want to have a lot of pages that do nothing good for you. Having a lot of static 404-catchers is not a good idea, so here's the better way:
(1) Include this line in your ".htaccess" file:
ErrorDocument 404 /errors-doc-folder/404.htm (2) Create the folder "errors-doc-folder" and store your template in that folder using the name "404.htm" (*)
(3) Upload your ".htaccess" file.
This way, you don't need all those "dead files" all around the place. Your custom 404 message (the template) will get shown for any 404 "automagically" - you can just delete all those other files.
/claus