Download & Extend

What kind of redirection does it do?

Project:Search 404
Version:6.x-1.1
Component:Miscellaneous
Category:feature request
Priority:normal
Assigned:zyxware
Status:closed (fixed)

Issue Summary

Hi,
I have setup search404 to automatically go to the page of the node if there is only one result.

But what kind of redirection does it do?

For instance, I'm migrating from my old website to the new one under drupal. I would like that if I go for instance to myoldsite.com/the-name-of-the-old-page.html, then it goes to mynewsite.com/the-name-of-the-new-page.html.

The name of the old and new pages are nearly the same, but could be a bit different, as the two websites do not use real url the same way. So I thought about .htaccess to put the same parameter to the new site that with the old one with a 301 code, and then using the search 404 in drupal to go to the real page.

But what I would like as well is that search engines do know this page is not the good one, and that they referr the good page after the search404 redirection. So I wonder, what kind of redirection do search404?

Thanks

Comments

#1

Assigned to:Anonymous» zyxware
Status:active» fixed

Hello Julien

The code that does this redirection is executed by drupal_goto (), the default redirect in drupal_goto () is 302 (Found) which is also the same which occurs in search404.

I hope that answers your question.

Regards
Zyxware

#2

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

#3

Category:support request» feature request
Status:closed (fixed)» active

Thanks Zyxware, could this be changed to 301 permanent? Or could we have an option to set this?

Google Webmaster reports duplicate titles for old 404 pages that were 302-d directly to new content found by search404.

#4

Status:active» needs review

Hi giorgio79

I have added "Use a redirect 301 instead of redirect 302" option in Search404 in the latest dev version commit.

Regards
Santhosh Raju

#5

Status:needs review» fixed

Marking as fixed

#6

Both 301 and 302 redirections return the code (301 or 302) and the new URL to the browser or spider, which then needs to issue a GET for the new URL. They are both used for when a resource has changed its URL, and the only difference between the two is that 301 is permanent and 302 is temporary. The whole point of sending back the information is so the requestor can update their records (bookmarks, search indexes, etc.).

If there is only one possible replacement for a missing (404) page, you want to do a 301 if it's a permanent change, or 302 if it will be reverting back some time soon. A 301 will tell Google, et al., to update their records and forget about the old URL.

Note that for "SEO/SEF" URLs, where the URL provided to the outside world is deliberately "fake" (but still on the same site), you really want to do a 200 (Found) and an internal rewrite. This all occurs on the server, and nothing except the full resulting page gets sent back to the requestor. They're none the wiser that the address was fake (so they don't update their address bar).

If the rewrite is the result of a 404, I'm not sure if you can keep the 404 status from getting back to the requestor, or if you can treat it like an SEO/SEF rewrite. Most SEO/SEF URL implementations seem to capture "not a legit file or directory" in .htaccess and send the request to a common rewrite page. I don't know for sure if a 404 status is actually seen at any point, or if the request has been rewritten before the status code is assigned. Perhaps someone with firmer experience in this area can comment?

#7

@Druid - Yes. When a 404 happens on a site with Drupal and Search404 the browser gets a 404 and then the 301/302 redirect.

#8

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.