This is a little off topic, but I got this in my email today and had to pass it on. Apparently, there’s a bird in Scotland who figured out that he can just walk into the local store and snatch a bag of chips.
Folks think he’s a nice bird, though. It seems that when he tears open the bag, he lets all the gulls partake of his booty. (I, however, think he’s just not very skilled at keeping the chips to himself)
There has been quite a bit of comments going back and forth on the code that I wrote to enable permalinks for Wordpress on IIS since I put it up on the site. Just recently, Einar Egilsson posted an extremely helpful bit a code in the comments. It’s a much better and cleaner way of accomplishing the same thing.
I was always aware that my solution was a little odd in that it used ASP. WordPress is written in PHP and to use ASP requires odd work-arounds. Einar gave us a great simple solution that uses PHP. It too requires 404 redirects, though.
It’s requirements are:
- IIS for Windows
- WordPress
- Ability to change your 404 error page with your web host.
To install, copy and paste this text into a file named wp-404-handler.php:
<?php
$qs = $_SERVER['QUERY_STRING'];
$_SERVER['REQUEST_URI'] = substr($qs, strpos($qs, ':80')+3);
$_SERVER['PATH_INFO'] = $_SERVER['REQUEST_URI'];
include('index.php');
? >
Next set the 404 error page to /wp-404-handler.php. If it gives you a choice between file and url, choose url.
Lastly, make sure you enable permalinks in the Wordpress control panel under Options > Permalinks.
That should do it.
Thanks to Einar for posting this in the comments and thanks to CaptainN who first wrote about in the Wordpress support forums.