PHP FastCGI 301 woes
Some time ago I wrote about installing PHP on IIS running in FastCGI.
Overall I’d say my experience has been ‘mixed’ to say the least. The performance increases are great however I’ve stumbled across various problems some of which have been easily resolved, others not so.
The latest one I’ve found really stands out as being an absolutely clanger of the highest proportions though.
Lately I’ve began an excercise in rewriting urls, using the ISAPI rewrite component in IIS. Alongside this, I also wrote some continuity redirects using PHP to tidy up links already out there in the ether.
Simple enough I hear you say, just issue a 301 HTTP status code. Fine I’ll do that. This is simple enough in PHP:
header("HTTP/1.1 301 Moved Permanently");
header("Location: mynewurl");
header("Connection: close");
exit();
Not so, even after much playing around issuing a header status and using different arguments within the header function - nothing.
To confirm matters I managed to find someone else going through my pain, a Zend confirmation of a 301 redirect bug, and even a listing on bugs.php.net. All of which seem to have resulted in a stale mate and various finger pointing that wouldn’t look out of place in a school ground.
At present I’m a little unsure of how to get round this one, I’ll probably move the responsibility of these rewrites to the ISAPI rewrite component however it does remove alot of the flexibility from doing within the application and turns something fairly straightforward in to a labour intensive task it didn’t have to be.
Bettering that, well use a proper web server or run PHP in a mode which isn’t as flaky.
About this entry
You’re currently reading “ PHP FastCGI 301 woes ,” an entry on Mike Howarth: Web Developer
- Published:
- 6.13.07 / 3pm
- Category:
- IIS, Isapi Rewrite, PHP
No comments
Jump to comment form | comments rss [?] | trackback uri [?]