Weblink for Drupal 4.3.0 appears to use an HTTP 302 (temporary) redirect for outbound link tracking. The semantic meaning of an HTTP 302 redirect imply that search engines should index the content found at the redirected location under the original URL.
For example, I have a Weblink for "Northern California Lab Rescue" which points to URL http://www.labrescue.org/Pages/dogs.htm. Google indexed the content retrieved from this URL under http://www.carde.com/weblink/goto/118. This is not desired behavior.
My reading indicates that the "correct" way to do this is an HTTP 301 (permanent) redirect. This indicates to a crawler that the redirected location is the permanent home of that content, and that the content should be indexed at that location.
I patched my copy of the Weblink module to use 301 redirects, and it does appear to fix the problem.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | weblink-301-patch_2.diff | 423 bytes | PilotChris |
| #2 | weblink-301-patch_0.diff | 423 bytes | PilotChris |
| #1 | weblink-301-patch.diff | 491 bytes | PilotChris |
Comments
Comment #1
PilotChris commentedWeblink for Drupal 4.3.0 appears to use an HTTP 302 (temporary) redirect for outbound link tracking. The semantic meaning of an HTTP 302 redirect imply that search engines should index the content found at the redirected location under the original URL.
For example, I have a Weblink for "Northern California Lab Rescue" which points to URL http://www.labrescue.org/Pages/dogs.htm. Google indexed the content retrieved from this URL under http://www.carde.com/weblink/goto/118. This is not desired behavior.
My reading indicates that the "correct" way to do this is an HTTP 301 (permanent) redirect. This indicates to a crawler that the redirected location is the permanent home of that content, and that the content should be indexed at that location. This is described in the HTTP protocol specification (RFC2616 - http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html) sections 10.3.1 and 10.3.2.
I patched my copy of the Weblink module to use 301 redirects, and it does appear to fix the problem. The patch is attached to this issue report.
Comment #2
PilotChris commentedComment #3
PilotChris commentedPlease don't use the first patch submitted in update #1. The second patch is the one that I MEANT to upload the first time. ;) Can you tell this is my first time using the Drupal issue tracking system?
Comment #4
dries commentedSet the status to 'patch' if you attached a patch. Thanks.
Comment #5
PilotChris commentedThis is the most embarassing experience, ever. Both previous patches I submitted were "reversed." This patch fixes that problem as well. Please don't shoot me!
Comment #6
gábor hojtsyFixed in current CVS version. Thanks.
Comment #7
(not verified) commentedComment #8
mikeryanThis seems to have broken along the way - the latest weblink has it commented out:
// Didn't this use to work?
//header("HTTP/1.0 301 Moved Permanently");
Comment #9
Bèr Kessels commentedplease reoprt back if this issue is still valid ibn the latest version. I now used simpler headers for redirecting.
Comment #10
gábor hojtsyEhem, PHP uses temporary redirects (302 Found), if you provide no status code yourself! Weblink should use permanent ones (301 Moved Permanently), not temporary ones! You should issue a status header when redirecting!
Comment #11
Bèr Kessels commentedweblink will be replaced by links. they use the correct HEADERS.