Partner and Community Forums
IIS replaces redirect status header from PHP with 302 Redirect automa...
Last post Aug 26, 2011 08:51 AM by HCamper
Jun 15, 2009 11:14 AM|peaceable_whale|LINK
Both of the following code...
header("HTTP/1.1 301 Moved Permanently");
HTTP/1.1 302 Redirect
Content-Type: text/html; charset=UTF-8
Date: Mon, 15 Jun 2009 10:09:41 GMT
instead of the expected...
HTTP/1.1 301 Moved Permanently
Content-Type: text/html; charset=UTF-8
Why does this happen?
Jun 15, 2009 12:32 PM|HostingASPNet|LINK
Try to make 301 redirect directly with IIS and tell us the result -
IIS 301 Redirect .
Jun 15, 2009 01:10 PM|peaceable_whale|LINK
301 is returned when the URL Rewrite Module is used.
Jun 16, 2009 06:05 AM|ruslany|LINK
This is a bug in IIS FastCGI module. It will be fixed in Windows 7 RTM. We are also looking into possible ways for making this fix available for IIS 7.
Jun 16, 2009 07:59 AM|peaceable_whale|LINK
Thanks! The problem doesn't seemt to affect the FastCGI Modules for IIS 5.1 and IIS 6. (I was not able to reproduce it with IIS 5.1, FastCGI 1.5 and PHP 5.2.9-2 NTS on VM)
Nov 30, 2009 08:14 PM|Ruben Marti|LINK
Is there any news on this?
I am having problems with search engines to not consider permanent redirects.
Thank you very much.
Dec 01, 2009 03:05 AM|peaceable_whale|LINK
I think the bug has been fixed. Do you have a link for us to test?
Dec 02, 2009 09:48 AM|backpacker86|LINK
Hi @all, any update on the fix?
@peaceable_whale : how do you come to the conclusion, that the bug has been fixed?
i cannot give a link to test, but i have tried it on our server 2008 with iis7 and updates installed and i cannot get it to work.
I use iirf 2 to rewrite my urls and php 5.3 nts in fastCGI mode.
To redirect the old url structure to the new one i use php because of the complexity of the url structures.
This is the code i use for the redirect:
$location = 'Location: '.$redirectUrl;
header('HTTP/1.1 301 Moved Permanently');
If i observe it with live http headers plugin for firefox it returns a 302 redirect.
So far it seems that there hasn't been released a bugfix yet.
I would be glad to be proven wrong.
One thing i noticed is that my redirect from trailing slash to non trailing slash url in iirf is not replaced with a 302 redirect, but this doesn't help in any way and it has already been pointed out by ruslany, that the replace with 302 redirect is a bug
in the fastCGI module.
If someone has any update on the matter please post it. I have to release our new site and it is due to the fifth of december...
Thanks in advance
Dec 02, 2009 04:25 PM|peaceable_whale|LINK
You are using IIS 7... not IIS 7.5...
I think the bug has been fixed in IIS 7.5. However, I am not sure if a patch or hotfox has been released for IIS 7. As a workaround, you may want to perform the redirect using the
URL Rewrite Module.
Dec 03, 2009 08:43 AM|Ruben Marti|LINK
In my case, I find it very difficult to use URL Rewrite. A php program calculates the new URLs of articles canceled for similar items.
I also read that this problem would be corrected in version 7.5, but I have not located any update for users of version 7.
Who should know of this problem so we can see a FastCGI update for version 7?
Thank you very much.
FastCGI 301 302
Dec 03, 2009 10:12 AM|don.raman|LINK
Yes, we are working on an update for FastCGI on IIS7. This bug will be included in that update.
Dec 05, 2009 02:55 PM|backpacker86|LINK
Thanks for the info.
When can we expect this update to be released?
I don't want to get into using the Rewrite Module of the IIS because but if the update won't be released anytime soon I will probably have no other choice.
Thank you in advance for any further info.
Dec 05, 2009 02:56 PM|backpacker86|LINK
I don't want to get into using the Rewrite Module of the IIS, but if the update won't be released anytime soon I will probably have no other choice.
Dec 05, 2009 08:45 PM|don.raman|LINK
I can't tell you exact dates but we are working hard to ensure that this gets released as soon as possible. Expect an update around the month of January though is is just an estimate.
Jan 19, 2010 01:56 PM|t.zander|LINK
Jan 19, 2010 05:59 PM|don.raman|LINK
Today we announced release of FastCGI 1.5 for IIS5.1/6.0. The next step is now to work on back port of this for IIS7.0 which will be happening soon and should fix this defect. Stay tuned, it should be relatively fast now.
Feb 02, 2010 03:46 PM|deab|LINK
I'm pretty sure it worked a year ago when I migrated to IIS7, but I just happened to check headers were fine as I'm changing some urls and found the 302 bug. Is it know when this broke or am I imagining it ever working?
Feb 02, 2010 03:57 PM|don.raman|LINK
We are still working on the release plan. I will let you know once we have done the release.
Feb 12, 2010 07:13 PM|Bambaataa|LINK
Ich brauch das Update ganz dringend, kann doch nicht sein das so ein Fehler über ein Jahr lang besteht?!
Feb 25, 2010 12:56 PM|Elmway|LINK
If only I had known about this bug before implementing big site changes... Surely there must be a rough release plan?
Mar 10, 2010 12:51 AM|don.raman|LINK
The FastCGI backport is available to be downloaded form Microsoft download centre and can be viewed at
http://www.microsoft.com/downloads/en/results.aspx?freetext=980363&displaylang=en&stype=s_basic. This should fix the above mentioned header redirect bug. The fix is available for Windows Server 2008 and Windows Vista.
Thank you all for the patience and let us know in case you are facing any problem.
Mar 11, 2010 07:59 AM|Elmway|LINK
It installed and works great on a Windows 2008 x64 web edition. On server 2 which is a 2008 x64 standard the install just display "Searching for updates..", it's been 1,5 hours now.
Mar 14, 2010 06:59 PM|deab|LINK
installed and tested on 2008 Server 32bit IIS7, works a treat :)
Mar 15, 2010 07:11 AM|don.raman|LINK
Thank you for testing and giving feedback. I would encourage everyone else to try this too.
Jun 11, 2010 10:13 AM|craig5320|LINK
Just like to say this has solved my headache this morning, I'm glad I wasn't one of the unlucky few who have been waiting since last year. I was able to find this solution the same morning I discovered the problem.
Hotfix installed, 301's functioning correctly.
May 27, 2011 07:30 PM|pgardner789|LINK
I'm having a similar problem, but with an asp redirect instead of a php redirect. I've set up a redirect and explicitly set the response status to 301, but IIS sends a 302 status instead. Will this fix address the problem?
May 27, 2011 08:16 PM|HCamper|LINK
Hello @ pgardner789,
I belive that Don stopped updating posts as of August 2010.
I do not know if still monitors the previous posts at IIS Net Forums.
So I suggest that create a new post / thread and include your question
and information for php_errors.log the Version of PHP installed with
how it was installed.
Then users in the PHP community and IIS Net Forum will try to answer and help with the issues.
May 27, 2011 08:26 PM|pgardner789|LINK
Thanks very much for the info, good to know.
My problem is not a php issue, i don't use php, my symptoms are the same, but i use asp, and i was hoping the fix addressed the issue regardless of which code is used for the original redirect.
i'll post my question in a different forum.
May 27, 2011 08:28 PM|HCamper|LINK
In the case of asp problems
I suggest the Rewrite or Scripting Forums.
Aug 19, 2011 01:16 PM|bndoshi|LINK
That URL is not working. Could you please guide me to correct page?
Aug 19, 2011 01:24 PM|HCamper|LINK
That URL which ?
Do you mean the link
to the FastCGI from IIS Net Download
here http://www.iis.net/download/fastcgi .
Aug 22, 2011 09:17 AM|bndoshi|LINK
Apologies for not been very clear.
I would like to install the patch to resolve the redirect issue suggested by don.raman
"The FastCGI backport is available to be downloaded form Microsoft download centre and can be viewed at
Aug 22, 2011 10:06 AM|HCamper|LINK
Many of the past Forum posts with links to Microsoft Download
Center have gone bad since the changes & redesign.
General Note: The freetext line 980363 is part of the KB980363 MS KB Article.
The reference is Microsoft Support Article and KB980363 here
The RuslanY Blog has a list for collection of patches
that has been updated with links X86 & X64 versions for All the Windows that the patches apply.
AFAIK the patches are have been offered by Windows Update.
I suggest you check the Support Numbers KB's in the list.
The patch may already be installed and problems are elsewhere.
Aug 26, 2011 08:44 AM|bndoshi|LINK
I am hosting my sites on a virtual server with Plesk. As soon as I updated the server it crashed and it took few hours for the engineers to revert back. I came to learn you shouldn't be updating windows directly when you have Plesk control panel installed.
All though this is not a Windows issue, I thought it's worth people know about this complication.
I think only option left for me is to control this through URL Rewrite module (which is difficult as the number of redirects are more than 6000) or Go for a fresh build server.
Thanks for you help,
Aug 26, 2011 08:51 AM|HCamper|LINK
Thanks for the update. Yes, Windows Update and cause issues.
Since your in a VM you may find this
for how to use Windows Installer in VM systems.