Php 301 redirects actually doing a 302 redirect?

It appears that the only answer to this one at the moment is to not use FastCGI on IIS7 when using PHP (because of a bug in FastCGI) - which is rubbish because it's very quick. Using isapi allows the 301 redirects to work as they should, but it's not as fast.

You would think so but no, it produces a 302 redirect – Paul Oct 13 '09 at 19:12 2 I would be tempted to delete this answer, but I think it'd be better to leave it here so someone else doesn't suggest the same thing. – Jacob Marley Oct 13 '09 at 19:27.

It should be as given by R. Bemrose; that's the usual example code. I guess there is something not-quite-right about your PHP execution environment.

Another method you can try is the CGI standard way of passing back a status line: header('Status: 301 Moved permanently'); header('Location: example.com/').

That should work, and I would expect it to, but it's just not. I read that it might be a bug in the FastCGI module, but I can't find anything to fix it. – Paul Oct 13 '09 at 19:36.

Microsoft released a fix for this: microsoft.com/downloads/en/results.aspx?....

Although not an answer, I thought it might be worth adding that I have a similar issue of getting a 302 instead of a 301, despite the coded status being set as 301 (using VB. Net). I should add that I'm using a custom "404" page to determine if the page really is not found, or if it is listed in our data table of historical redirects.Me.Response.

Status = "301 Moved Permanently" Me.Response. AppendHeader("Location", rootPath + NewPage) The rootPath and NewPage variables are obtained from Request. ServerVariables and a SQL database table respectively.

Using the nicely detailed HTML analysis viewer from http://www.rexswain.com/httpview.html the server sends a sequence of status codes as: 302 (the custom 404+301 page handler), then 301, then 200 (the page redirected to). I've not found anyone suggesting an alternative code method. The best result seems to be manually configuring each 301 in the IIS management console, but this requires that the original file remains on the server, which ain't great.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions