IIS replaces redirect status header from PHP with 302 Redirect

Posted by IP on Server Fault See other posts from Server Fault or by IP
Published on 2009-09-11T00:08:02Z Indexed on 2010/04/10 18:03 UTC
Read the original article Hit count: 468

Filed under:
|
|
|

Hello

I hope I am posting this in the correct place...

I'm having an issue with a 301 redirect in php. Looking at the headers, if I do a simple 301 redirect, it actually appears as a 302 redirect which is not what I am after.

This is the php code:

header("Status: 301 Moved Permanently");
header('Location: newurl');

It is running on the latest version of php, IIS7 and uses the FastCGI module (which is apparently where this bug could exist).

A quick Google finds other people with the same problem, but no actual solution. http://www.mombu.com/php/bugs-forum/t-301-redirect-returning-302-instead-3090775.html http://forums.iis.net/p/1158431/1907156.aspx

Many thanks! Paul

© Server Fault or respective owner

Related posts about php

Related posts about iis7