[wpmu-trac] [WordPress MU Trac] #906: wp_redirect function & IIS 7.0
WordPress MU Trac
wpmu-trac at lists.automattic.com
Thu Feb 19 09:49:37 GMT 2009
#906: wp_redirect function & IIS 7.0
------------------------+---------------------------------------------------
Reporter: frumph | Owner: somebody
Type: defect | Status: new
Priority: low | Milestone: 2.7
Component: component1 | Version: 2.7
Severity: normal | Keywords:
------------------------+---------------------------------------------------
O/S: Windows Server 2008 with IIS7.0
Symptom:
Every time a redirect happened a 404 error page would show up before the
redirected page comes up.
in wp-includes/pluggable.php:
{{{
if ( $is_IIS ) {
header("Refresh: 0;url=$location");
} else {
if ( php_sapi_name() != 'cgi-fcgi' )
status_header($status); // This causes problems on
IIS and some FastCGI setups
header("Location: $location");
}
}}}
Sending a Refresh to the IIS server caused it to happen. So to fix it I
basically just did header("Location: $location"); as below but that didn't
seem too sanitary so I instead went to the wp-includes/vars.php where it
determined what was exactly IIS and just put this in:
{{{
/**
* Whether the server software is IIS or something else
* @global bool $is_IIS
*/
if (strpos($_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS')) {
if (strpos($_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS/7.0')) {
$is_IIS = false;
} else {
$is_IIS = true; // (strpos($_SERVER['SERVER_SOFTWARE'],
'Microsoft-IIS') !== false) ? true : false;
}
} else {
$is_IIS = false;
}
}}}}
--
Ticket URL: <http://trac.mu.wordpress.org/ticket/906>
WordPress MU Trac <http://mu.wordpress.org/>
WordPress Multiuser
More information about the wpmu-trac
mailing list