Permalinks for WordPress on a Windows Server

When it comes to WordPress and permalinks, Linux servers are usually a piece of cake to work with, but when it comes to Windows servers, permalinks can become a pain in the butt.

Let’s have a look..

Problem/Summary

With WordPress installations or many other CMS Applications you might have links that look like any of the following:

http://www.imod.co.za/?id=2

or

http://www.imod.co.za/index.php/my-life/

Resolution

What needs to be done is to create a httpd.ini file which uses ISAPI Rewrite to reformat your URLs nicely so they will look like:

http://www.imod.co.za/my-life

This is what the httpd.ini code should look like:

[ISAPI_Rewrite]

RewriteEngine On

RewriteBase /
RewriteCond ${REQUEST_FILENAME} !-f
RewriteCond ${REQUEST_FILENAME} !-d
# For special WordPress folders (e.g. theme, admin, etc.)
RewriteRule /wp-(.*) /wp-$1 [L]

# For all WordPress pages
RewriteRule ^/$ /index.php [L]
RewriteRule /(.*) /index.php/$1 [L]

That’s it – much like an .htaccess file, create the httpd.ini file, paste the above code into it, save it and upload it to your server.

via Web Africa

Christopher is the founder of iMod - Most of his time is spent building websites and pushing the limits with Search Engine Optimization. You can follow him on Twitter @ChristopherM

Enjoy this post? Please tell a friend:

6 Comments on "Permalinks for WordPress on a Windows Server"

  1. The best Windows web hosting solution I have ever come across is “don’t use it”.

  2. Chris M says:

    Lol, ye mate, totally! I don’t have a choice in this regard unfortunately.

  3. Jim Phillips says:

    I notepadded the script, named is httpd.ini, uploaded the file to the root directory, and when it did not work, also to the theme root directory. Still no luck. The plain name appears in the url but display a 404. What am I missing?

    Permissions to some file to write, perhaps? A plug-in? Anyway, cannot get it to work.

  4. For this to work, you need to have the ISAPI filter installed on your Windows server. It costs $99.

    http://www.isapirewrite.com/

    That’s the thing with the Windows platform – not much is Free Open Source Software.

  5. Chris M says:

    Ye, ISAPI filter is required indeed. It’s a serious shortfall with Windows servers, lots of hidden costs for requirements :/

  6. There’s also something called IIS Mod Rewrite which mimics Apache’s mod rewrite.

    Again the Pro version is needed (for a web hoster) hosting multiple virtual domains. $150 per server. ouch.

    Instructions for getting IIS Mod Rewrite to work with WordPress permalinks.

    Btw, Chris, the reason I’m adding to this thread is because I am in the same boat as you were – having a client insist on using a Windows host.

    What’s really special about using IIS Mod Rewrite is that the instructions for getting it to work include hacking the WordPress core code.

    And the kicker is, the web dev doesn’t get to choose whether to use ISAPI Rewrite or IIS Mod Rewrite. That choice is determined by the owner of the server. What they install is what you gotta work with.

Got something to say? Go for it!