Blog

Wordpress Permalinks on IIS

If you plan on using Wordpress on a Windows IIS server and want nice url names for your posts, you may have encountered the ‘Permalinks World of Pain’, where basically none of your urls work.

After hunting around the web, I found that many people used a custom 404 file. None of the code examples worked out of the box for me, so I had to edit it slightly. The following gives the code and steps required.


1. Create a new file in your root web folder (where your wordpress files also sit) and call it ‘wp-404-handler.php’.

2. Put the following inside it’s php tags:

$qs = $_SERVER['QUERY_STRING'];

$_SERVER['REQUEST_URI'] = substr($qs, strpos($qs, ':80')+3);

$_SERVER['PATH_INFO'] = $_SERVER['REQUEST_URI'];

include('index.php');

3. In your IIS window, custom errors tab, edit the 404 entry as seen here:

iis-404

4. In your Wordpress admin dashboard, go to settings->permalinks, choose Custom Structure and enter:
/%category%/%postname%

L

Featured Projects BBCiPlayer on BT Vision LOVEFiLMPlayStation®3 App PushbuttonpbRemote LOVEFiLMiPad App

© Pushbutton 2010