Forum Moderators: phranque

Message Too Old, No Replies

302 to 404 / 410?

         

Mark26

8:37 pm on Jul 21, 2011 (gmt 0)

10+ Year Member



I've installed a SEO mod for my forum some time ago and everything worked nice at the beginning. Now I'm suddenly having the problem that deleted post URLs (from removed forums / topics) get 302 redirected to the correct phpBB error page which gives out a 404 / not found. I could change that to 410 / gone if it helps, but my question is how will search engines likely react to such behavior?

Will they remove those sites from the index over time (which I hope for) or e.g. index thousands of custom 404 error pages with different URLs?

Thanks in advance!

P.S.: The rewrite rule(s) in the .htaccess are very complex so it's impossible for me to find the error there.

g1smd

8:40 pm on Jul 21, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



That's a bad situation to be in, especially if the "error" page actually returns a "200 OK" status when you eventually get there.

The 404/410 http status code should be returned at the originally requested URL.

You want to say "this" URL does not exist, not redirect to some other URL that then says that it does not exist.


It's like going to the shop and finding a sign on the front door saying to use the other entrance, and when you get there it has a "closed" sign. You'd much rather have seen the opening times on the front door.

Mark26

9:25 pm on Jul 21, 2011 (gmt 0)

10+ Year Member



I'm not exactly happy about the situation. It's Status: HTTP/1.1 302 Found --> Status: HTTP/1.1 410 Gone btw.

g1smd

9:57 pm on Jul 21, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



That's less suicidal but still a very long way from ideal.

Mark26

10:14 pm on Jul 21, 2011 (gmt 0)

10+ Year Member



In this thread [webmasterworld.com ] tedster wrote:

Even a 302 redirect WITH the appropriate script to change the status of the target custom error message page has not caused duplicate url indexing problems for any site I work with. In other words, 302 to 404 has not caused any problems in practice for me. The problems show up when you serve a 302 to a 200.


Anyways, the situation is very bad like you said. I could add a Disallow for the (deleted) post-URLs in the robots.txt to "solve" the problem I guess.

lucy24

11:27 pm on Jul 21, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



The rewrite rule(s) in the .htaccess are very complex so it's impossible for me to find the error there.

Now that's suicidal :) I assume it means someone else wrote the htaccess. Are you able to edit it now that it's there? With some software packages you have to jump through a few extra hoops-- or ask your host nicely-- to override their defaults.

Mark26

7:47 am on Jul 22, 2011 (gmt 0)

10+ Year Member



The .htaccess rules are being generated by the phpBB-mod depending on the settings one choices. Yes, I can edit the .htaccess. ;-)

g1smd

8:37 am on Jul 22, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Make sure that the .htaccess contains:

ErrorDocument 404 /somefile.php


and NOT

ErrorDocument 404 http://www.example.com/somefile.php


The latter case generates a 302 redirect as explained in a warning note in the Apache documentation.

Mark26

8:50 am on Jul 22, 2011 (gmt 0)

10+ Year Member



The .htaccess doesn't contain an ErrorDocument entry.

Mark26

9:36 am on Jul 23, 2011 (gmt 0)

10+ Year Member



Luckily - at least in my case - Google has no problem with the incorrect 302 redirects to pages giving out the right 404/410 HTTP Status Code. In the Webmaster Tools -> Crawl errors it lists the original deleted pages as 404 / Not found or 410 / Gone.

g1smd

4:11 pm on Jul 24, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You may have been lucky - so far.

Often these are flagged as "soft 404 errors".

Mark26

9:41 am on Jul 25, 2011 (gmt 0)

10+ Year Member



Not a good idea to bank on luck here. So I spent a few hours troubleshooting and could solve the problem in the end. Now there is no redirect anymore, just a clear 410 / Gone.