Installing Wordpress on IIS wasn’t the chore I thought it was going to be. It took me probably 2 minutes to setup the database, datasource, unzip wordpress, modify the config file, and I am up and running. However, there is a big problem with running Wordpress on a Windows Server.

The Problem:

By default, Wordpress has ugly queries URL’s and fixing the permalink structure does not get rid of that ugly index.php in the URL. Ex: http://www.rtrask.com/index.php/category/seo/

Since Wordpress was designed to run on Apache and use mod_rewrite for clean and pretty URL’s does that leave us Windows hosts and developer out in the cold? Not exactly.

The Solution:ISAPI Rewrite

Download and install ISAPI_Rewrite on your server, paste the following code in your httpd.ini file in your root directory of your blog website and your up and going.  

[ISAPI_Rewrite]

# Rules to ensure that normal content gets through
RewriteRule /blog/software-files/(.*) /blog/software-files/$1 [L]
RewriteRule /blog/images/(.*) /blog/images/$1 [L]
RewriteRule /blog/favicon.ico /blog/favicon.ico [L]

# For file-based wordpress content (i.e. theme), admin, etc.
RewriteRule /blog/wp-(.*) /blog/wp-$1 [L]

# For normal wordpress content, via index.php
RewriteRule ^/blog/$ /blog/index.php [L]
RewriteRule /blog/(.*) /blog/index.php/$1 [L] 

Next, add a php.ini file to your website root directory and paste this code in the php.ini file:

cgi.fix_pathinfo = 1
cgi.force_redirect = 0

The Fixed URL

Much prettier now: http://www.rtrask.com/category/seo/ 

Anything Else?

Nope. That should be it, and you should be up and running. Thanks to Basil Vandegriend for the solution.