0

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

Paul
  • 221
  • 5
  • 15

1 Answers1

1

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.

mattbasta
  • 641
  • 1
  • 8
  • 17