Forum Moderators: open

Message Too Old, No Replies

404 Page - Log shows Google Received a 302

Will Google spider the links on the 404 page?

         

shawn

12:51 am on Aug 27, 2003 (gmt 0)

10+ Year Member



I have recently changed the pages from html-htm to shtml. When Google tries fro one of theold page extensions it get to the 404 page where I have links to the new pages.

I noticed in my server log that it is a 302 code. Will Google spider the links on this page or is it going away and not bothering with it?

Shawn

mcavic

4:48 am on Aug 27, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It sounds like your server is using a 302 to redirect from the nonexistant page to a custom error page.

If the error page itself returns a successful status, then Google should follow the links. But, the old url will still be indexed forever.

It would be better for the nonexistant page to actually return a 404.

jdMorgan

5:00 am on Aug 27, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



On Apache server, a very common error is to specify a custom error document like this:

ErrorDocument 404 http://www.yourdomain.com/custom_404.html

The problem is that this results in a 302 redirect. The proper form is:

ErrorDocument 404 /custom_404.html

using only a local path.

See Apache core ErrorDocument [httpd.apache.org], especially the notes at the end.

Jim

shawn

5:21 am on Aug 27, 2003 (gmt 0)

10+ Year Member



ErrorDocument 404 [yourdomain.com...]

The problem is that this results in a 302 redirect. The proper form is:

ErrorDocument 404 /custom_404.html

using only a local path.
See Apache core ErrorDocument, especially the notes at the end.

Jim

Jim,

I am using a custom error page; I had this on the htaccess:
ErrorDocument 404 /custom_404.html
The problem with that was if the visitor received an 404 for apge that was maybe 2 levels in the images for the custom error were broken(the image links).

So I changed to: ErrorDocument 404 [yourdomain.com...]

I can change back - is there a way to prevent the broken links to the images on the error page?
Shawn

chiyo

5:28 am on Aug 27, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



We had the same experience as you Shawn. Just make the image and other links in your custom 404 absolute links rather than relative.. e.g. www.mydomain.com/images/main.gif, rather than ../images/main.gif

That way the link will always be correct no matter from what folder is it viewed from.

shawn

5:54 am on Aug 27, 2003 (gmt 0)

10+ Year Member



chiyo,

Thanks for your reply - that fix hit me after I made the post. I said to myself "ahh you dummy just make them adsolute links".

I did that and now it is working and the 404 page is getting a code 200. I hope that will allow for google to get links on that page crawled with the pages with the new extensions.

Thanks for everyones help -

Shawn

MonkeeSage

5:57 am on Aug 27, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm just now learning about .htaccess. Just read a tutorial on it last night. If I am remembering correctly, the .htaccess that is closest to the current file / path will be used. So if the only .htaccess is in the root, and they are eight levels into the site, then the .htaccess from root is still used because it is the closest (only) one available. I think you can use multiple .htaccess files as a solution, then it will use whichever one is closest.

chiyo's solution sounds alot easier though! (*goes off to delete extra .htaccess files and fix the root one*). :)

Jordan

incywincy

6:54 am on Aug 27, 2003 (gmt 0)

10+ Year Member



not sure if i am missing something here but if you have moved your pages from .html/.htm to .shtml wouldn't a permanent redirect solve the problem? as a user i would find this much more user friendly.

shawn

3:33 pm on Aug 27, 2003 (gmt 0)

10+ Year Member



not sure if i am missing something here but if you have moved your pages from .html/.htm to .shtml wouldn't a permanent redirect solve the problem? as a user i would find this much more user friendly.

Visitors to the site will not see any 404 pages etc...all the menus and links within the site have been chaged to reflect the changes.

Google seems to be the only one stumbling a bit. I suppose if the visitor comes in on a page that is indexed under the old file extension they would get the 404 page, however, they would also be presented with a link to go to the correct page.

I am not sure how I would set up a permanent redirect for each changed page.
For example:

user goes to www.mydomian.com/oldpage.htm and is redirected to www.mydomian.com/oldpage.shtml

How would that be done and have it appear seamless to the user? I am open to all suggestions :)

Shawn