Pretty URLs in Wordpress on Windows IIS

Web Development Add comments

When I first installed Wordpress I was eager to jump right in. Little did I know that being on a Windows server would have great impact on how my blogs would function. I had to search high and low for plugins to make my emails work via the wpPHPMailer and other little things. What upset me the most was that I was not able to have pretty URLs or the nice permalink structure we’re accustom to seeing on blogs.

This was a hard find back then but I kept with it. I couldn’t find it on Wordpress forums or anything. Then I Google’d and search and search and finally came across this solution from Keyboard Face:

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.

Thanks again to Tom at Keyboard Face, Einar and CaptainN for posting it on the Support Forum in Wordpress

Other Posts You Might Be Interested In:

Your Thoughts?

© 2007 Mayhem & Chaos Productions. All Rights Reserved.            Entries RSS Comments RSS Login