Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

Many thanks! Paul

share|improve this question

Try this for your first line:

header("HTTP/1.0 301 Moved Permanently");

I'm going to make a bet that IIS isn't recognizing the Status: token.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.