Closed (fixed)
Project:
Global Redirect
Version:
4.7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
1 Feb 2007 at 05:08 UTC
Updated:
16 Aug 2009 at 10:09 UTC
I'm not sure if this is a bug, if it's not I apologize.
Basically, by default the headers that are sent during a redirect say "HTTP/1.x 301 OK" instead of "HTTP/1.x 301 Moved Permanently"
I found changing...
if (!empty($alias)) {
header("HTTP/1.1 301 Moved Permanently");
drupal_goto($alias);
To the following...
if (!empty($alias)) {
header("Status: 301 Moved Permanently");
drupal_goto($alias);
Seemed to send the correct headers. I'm not sure if this is just my install environment, but I read about a similar issue with Drupals "/includes/common.inc" file in regards to a 404 OK instead of 404 Page Not Found... None the less, I'm not making sense now, this is the link that first sparked my concern. http://tips.webdesign10.com/drupal-seo-404-ok-and-htaccess
Comments
Comment #1
nicholasthompsonWhat's your system? I'll test this on mine today with Apache 2.0 and PHP 5.1 (and 4.0 on live).
Comment #2
hass commentedsounds like another PHP bug regarding status messages... On my Apache 2 it is currently working well.
Comment #3
niklp commentedI'm confused - is this a bug or not...?
Comment #4
nicholasthompsonI just ran that from my Mac Book Pro targeting my own Thingy Ma Jig site running Drupal 4.7.6 on PHP 5.0.4 and Apache 2.0.54.
Looks to me like its setting the correct header...
There is a chance that these kinds of issue are going to be VERY config related - so could people please post as much config info as they can when reporting this issue?
Comment #5
citricguy commentedI just upgraded to Drupal 5, but I still have the same issue. When PHP is run as CGI (I think this is the cause at least) you get different header output for the same code.
This is a string of code I found in another project that checks for CGI installs.
if ($api == 'cgi' OR $api == 'cgi-fcgi')Here is my configuration:
Modules Installed
Drupal 5.x
Global Redirect 5.x
Google Analytics 5.x-1.x-dev
Google Sitemap 5.x-1.0
Node style 5.x-1.1
Meta tags 5.x-1.0
Pathauto 5.x-1.0 (disabled)
Front Page 5.x-1.6 (disabled)
Server Setup:
Server API: CGI
Apache/1.3.37 (Unix) mod_fastcgi/2.4.2 mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 FrontPage/5.0.2.2635.SR1.2 mod_ssl/2.8.28 OpenSSL/0.9.7a PHP-CGI/0.1b
Comment #6
nicholasthompsonok - i've just got a disposable dev server setup for be to play with and break to my hearts desire. I'll try out PHP-CGI on it (once I figure out how). Without it I cant really test it.
Comment #7
bradlis7 commentedIssue #64645 might contain useful information.
Comment #8
nicholasthompson4.7 is no longer supported and there is a fix in 5 and 6.
I also just testing my thingymajig site again (as in post #4) which is now running Lighttpd+PHP 5.2.6 in FastCGI mode. I get a proper 301 header.
Marking as fixed.
Comment #9
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.