Using WordPress on IIS7

January 3, 2009 · 25 comments

I’ve been running WordPress 2.7 for a few weeks now and I have been very happy with it so far. In this post I’ll share my thought process behind running WordPress on IIS7 and the details on how I have it setup.

I setup my first blog back in 2006 running on dasBlog. I was never really happy with it, mostly because I couldn’t find a theme I liked. I wrote a few posts, then when I changed hosting providers, I never setup the permissions correctly and was unable to post. It would have been an easy fix, but it became an excuse to not blog.

When I decided to start blogging again, I wanted something that would be easy to setup, and wouldn’t take a lot of effort to maintain. Since I’m a fan of Google’s offerings, I started off using Blogger. Unfortunately, I ran into some DNS limitations and couldn’t get things setup the way I wanted. I also checked out the hosted WordPress solution, but it was even more limited then Blogger.

I decided to use WordPress as my blogging platform because there is a very active community, lots of themes available, and because you there are plugins that allow you to add whatever features you want without any coding.

Since IIS7 has decent PHP support, I decided to use a Windows plan on This will allow me to put .NET apps on my site down the road. I also have another site that I need to host that requires .NET and this keeps my hosting costs lower.

Installing WordPress 2.7 was pretty easy. I just had to create a MySQL database, upload the WordPress files and run through the setup.

Next, I had to get pretty permalinks working the way I wanted them. One way to do this would be to use Microsoft’s URL Rewrite Module. The problem is that GoDaddy doesn’t currently support the URL Rewrite Module (I’ve heard that they plan to support it soon). I ended up using the ManagedFusion Url Rewriter.

Setting Up the Managed Fusion Url Rewriter to work with WordPress

Download the ManagedFusion Url Rewriter files here.

If you don’t already have one, create a folder named “bin” at the root of your blog.

Copy ManagedFusion.Rewriter.dll and ManagedFusionRewriter.pdb into the bin folder you just created.

If you don’t have one, create a file named “web.config” in the root folder of your blog that looks like the one below, otherwise just add the info to your existing web.config.


        <validation validateintegratedmodeconfiguration="false" />
            <modules runallmanagedmodulesforallrequests="true">
                <add type="ManagedFusion.Rewriter.RewriterModule, ManagedFusion.Rewriter" name="RewriterModule" />
                <add type="System.Web.HttpForbiddenHandler, System.Web, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" name="RewriterProxyHandler" path="RewriterProxy.axd" verb="*" precondition="integratedMode" />

Create a file named “ManagedFusion.Rewriter.rules” in the root folder of your blog. This will allow you to use .htaccess syntax to handle the Url Rewrites. I set mine up to remove the www from my hostname, remove index.php from the url, and redirect urls from my old blog to the new location.


#  Managed Fusion Url Rewriter
#  Developed by: Nick Berardi
#       Support:
RewriteEngine on
# Place Rules Below
# misc WordPress rewrites
RewriteRule ^/wp-login\.php$ /wp-login.php [L]
RewriteRule ^/wp-comments-post\.php$ /wp-comments-post.php [L]
RewriteRule ^/wp-admin/(.*)$ /wp-admin/$1 [L]
# deny access to evil robots site rippers offline browsers and other nasty scum
RewriteCond %{HTTP_USER_AGENT} ^Anarchie [OR]
RewriteCond %{HTTP_USER_AGENT} ^ASPSeek [OR]
RewriteCond %{HTTP_USER_AGENT} ^attach [OR]
RewriteCond %{HTTP_USER_AGENT} ^autoemailspider [OR]
RewriteCond %{HTTP_USER_AGENT} ^Xaldon\ WebSpider [OR]
RewriteCond %{HTTP_USER_AGENT} ^Xenu [OR]
RewriteCond %{HTTP_USER_AGENT} ^Zeus.*Webster [OR]
RewriteCond %{HTTP_USER_AGENT} ^Zeus
RewriteRule ^.* - [F,L]
# remove www
RewriteCond %{HTTP_HOST} ^www\.robboek\.com$ [NC]
RewriteRule ^(.*)$$1 [R=301]
# redirect old urls
RewriteRule ^/2008/12/blog-on-hold.html$ /2008/12/12/blog-on-hold/ [R=301]
RewriteRule ^/2008/11/google-chrome-wont-start-in-vista-x64\.html$ /2008/11/16/google-chrome-wont-start-in-vista-x64/ [R=301]
RewriteRule ^/2008/11/pass-community-summit-2008-events.html$ /2008/11/14/pass-community-summit-2008-events-calendar/ [R=301]
RewriteRule ^/2008/11/fort-stevens-camping-trip.html$ /2008/11/14/fort-stevens-camping-trip/ [R=301]
RewriteRule ^/2008/10/first-post.html$ /2008/10/10/first-post/ [R=301]
RewriteRule ^/blog/CommentView,guid,1d8cba50-0814-4c89-86df-eca669973e8e.aspx$ /2006/09/29/junctions-in-windows-vista/ [R=301]
RewriteRule ^/blog/2006/09/29/JunctionsInWindowsVista.aspx$ /2006/09/29/junctions-in-windows-vista/ [R=301]
# rewrite all nonexistent files and directories to use index.php for WordPress
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /index.php$1

I also setup a custom 404 error page that will allow me to use the WordPress 404 page in my theme.


$pos = strrpos($qs, '://');
$pos = strpos($qs, '/', $pos + 4);
$_SERVER['REQUEST_URI'] = substr($qs, $pos);

Plugins I’m using

DISQUS Comment System

The main reason I’m using DISQUS is because comment notification emails weren’t working for me with the default WordPress comments. It does add some nice functionality though, including threaded comments, comment spam protection, facebook connect integration and more. The other thing I liked about DISQUS is that all of my comments are synced in the WordPress database so if I ever want to stop using DISQUS, all I need to do is disable it.

FeedBurner FeedSmith

Redirects the RSS links over to my feed on FeedBurner.

Google Analyticator

Makes it easy to add Google Analytics tracking codes. It also has some nice features like disabling tracking for blog administrators.

Simple Google Sitemap

Generates an XML sitemap to give to the search engines. If you haven’t tried Google Webmaster Tools it’s worth a look.


Easy to use syntax highlighting code like you see in this post.

Other tweaks

I’m running the Revolution Code Grey theme, with a FriendFeed badge, a DISQUS comments widget and a and Twitter updates widget. The rest are just the standard widgets that come with WordPress.

I’m also using my blog as an OpenID using my Google account for authentication.

{ 23 comments… read them below or add one }

Leave a Comment

{ 2 trackbacks }