Have you ever had to work with a client’s site on WordPress on Windows IIS web hosting (like Godaddy) – and you have no idea how to get the permalinks to work? The problem is mod_rewrite generally doesn’t work on Apache with Windows webhosts. Sometimes with a client – moving the entire WordPress site from Windows to Linux isn’t an option (or in their budget). So what can you do?

Believe it or not, there is another way. In the root of the Windows web site find a file called “web.config” (an XML file), and download it to your local PC. Open it in a text editor (like Notepad), and you’ll see something like this:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules/>
</rewrite>
</system.webServer>
</configuration> 

Just change that to this, and save on your local PC, and re-upload in FTP:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Main Rule" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="index.php/{R:0}" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>

This IIS fix is not a complete fix for mod_rewrite, but you will be able to get “pretty permalinks” working in WordPress hosted on Windows web hosting. I fixed this on Godaddy – and the URL’s worked just fine.

For more information visit the Using Permalinks page in the WordPress Codex.