Download & Extend

Change 302 redirect to 301 redirect

Project:Secure Pages
Version:6.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs work

Issue Summary

I checked the header status of the redirect with the following tool
http://www.seoconsultants.com/tools/headers.asp
and noticed its response was 302 redirect.

I think using a 301 redirect would be a better choice. Thought?
http://www.bigoakinc.com/blog/when-to-use-a-301-vs-302-redirect/
http://www.mattcutts.com/blog/seo-advice-discussing-302-redirects/

I have included a patch to make the necessary change.

I dont know why anyone would want this redirect to be a 302 but if there is a use-case we could include a admin setting to switch between 301 and 302 redirects. Thoughts?

AttachmentSize
securepages_301_redirect.patch697 bytes

Comments

#1

I agree that a 301 seems more appropriate. no?

#2

Status:active» needs work

Use API functions for "header" in Drupal, please. See http://api.drupal.org/api/function/drupal_set_header/6

#3

I personally feel this issue is only related to changing the redirect to a 301 (which the patch does fine), the module uses header() in quite a few places and changing to drupal_set_header() should be a separat issue

#4

I think I have the same problem in that requests to http://mysite.com are using 302 redirects to https://mysite.com instead of 301.

How do I fix this? My .htaccess and httpd.conf files are using 301 redirects properly, but I think the issue I'm having is with the Drupal core files/functions. I can't find the module that is specified above.

#5

The patch works for me. It would be great if this could be rolled into 6.x-1.x