Closed (fixed)
Project:
Search 404
Version:
4.7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
15 Sep 2006 at 14:05 UTC
Updated:
1 Apr 2007 at 13:32 UTC
I was trying to set up my site with google analytics and got this error:
"We've detected that your 404 (file not found) error page returns a status of 200 in the header."
This is because I'm using the search404 page which is redirecting it to the search engine. I think that when redirecting an bad URL that at the very least bots need to be sent the proper headers:
drupal_set_header('HTTP/1.0 404 Not Found');
I like the usability of the search404, but would like to make sure that only valid links get stored with the search engines.
Mike
Comments
Comment #1
marafa commentedhi ..
is there a resolution to this problem?
but is this a search404 problem or a drupal core problem?
Comment #2
larssg commentedHi, marafa. It's clearly a problem with Search404 and I agree with mgifford that a 404-header should be returned. I plan to fix this ASAP.
Comment #3
criznach commentedIt looks like simply adding
doesn't work.
Comment #4
criznach commentedI also tried hooking the search form_alter after the redirect and sending the 404 header from there. It doesn't work, so I'm guessing that for Google to be happy the first response has to be the 404. With the current implementation, there's a 302 redirect to the search page sent first.
One possible solution would be to display the search form and results on the search404 page funciton without redirecting to search/node.
Comment #5
larssg commentedI have had a look at this today. I tried simply outputting the HTML from search_data($keys) which this module did once (see http://cvs.drupal.org/viewcvs/drupal/contributions/modules/search404/sea...). This would allow me to send the 404-header, but the previous and next-buttons don't work when I do this.
Any hints, ideas, etc.?
Comment #6
forngren commentedFixed in 5.x series http://drupal.org/node/128884
Comment #7
(not verified) commented