Does the Go Redirection Module v. 5.x-1.3) use 301 (or 302) Redirects?

Unlike the URL Redirect module (offer selecting from 301 or 302) the Gotwo module doesn't offer a choice. Does it default to 301 Redirects? Or am I missing something on how the gotwo redirects are done?

Thanks!
Ethan
http://www.UsefulTalk.com
http://www.PredictionCentral.com

Comments

ethanre’s picture

Priority: Critical » Normal
ethanre’s picture

Title: Go URL Redirection (GoTwo) and the use of 301 Redirects » Big Problem: gotwo creates 302 redirects - How to modify to use 301 ?
Category: support » bug
Priority: Normal » Critical

I used a header checker service and found that the Go URL redirection is creating 302 redirects (not a 301) redirect.

302 redirects are very bad for SEO and google hates them.

How do I change gotwo.module to use 301 Redirects so search engines don't penalize my site ranking?

Help please.

gaijinu’s picture

Indeed, it's not pretty.
I believe the module is using either http-equiv="refresh" meta tag or drupal_goto() - depends if you want to put a disclaimer or not.
The default for drupal_goto() is to use a 302 code see http://api.drupal.org/api/function/drupal_goto/5

You can not send a 301 status code via META tags.

In PHP can be done with:

// Permanent redirection
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://www.somasite.com/");
exit();

Cheers

gaijinu’s picture

Oh, and the solution is don't use the disclaimer at all and modify the line 142 in gotwo.module
from

drupal_goto($res->dst);

to
drupal_goto($res->dst,$query = NULL, $fragment = NULL, $http_response_code = 301);

Cheers,
Gaijinu
http://seoexpert.sg

hass’s picture

hm... i have no good idea how we should implement this with the "go" tags...
<go href="http://example.org/test/page" title="my label">An example</go>

I'm not a regex guru and it could take me hours if not days to get a working one that does a different filtering for something like
<go href="http://example.org/test/page" title="my label" http_response_code="301">An example</go>

Normally i don't like to use 301 in my gotwo links, while i'm only using it for external links and they should definitely be 302! Not sure why we need a 301... is there any good example why you need links with a 301? If you'd like to redirect from old urls to new ones - path_redirect is the module of your first choice, but as i understand gotwo - this module is not build for redirecting old urls to new urls for spiders...

BioALIEN’s picture

I wholeheartedly agree with hass's assessment above. I never would have thought to use the gotwo.module for permanent redirection.

I also don't see a clear way to incorporate a choice between 301 and 302 redirection per 'go' url. In theory, one way could be to have an admin option to set the default behavior e.g. '302 redirection' and then an override for each 'go' url on the 'Go List' module admin page to set individual urls to 301. This way, we can avoid messing with the current filter code. But personally, I think this is overkill for our nifty little module.

hass’s picture

Status: Active » Postponed (maintainer needs more info)

So we need more info for better understanding. Today i would say "by design".

ethanre’s picture

Priority: Critical » Normal
Status: Postponed (maintainer needs more info) » Closed (works as designed)

Thank you guys for your replies.

I use the module to mask links to 3rd party websites to make the links look more human friendly.

Thanks

hass’s picture

Such external links should be 302 and not 301

ethanre’s picture

Assigned: Unassigned » ethanre

Thanks