Removing /index.php/ from Permalinks in WordPress on Windows Server / IIS using URL Rewrites in web.config

By John Biswell on 20th June, 2013.

Windows and WordPress

A common issue when running WordPress on Windows Server and IIS is that by default you will see /index.php/ in all URLs. We want to removing /index.php/ from permalinks and make things look a bit more tidy.

Most users prefer much more user friendly URLs without “/index.php/”. Fortunately it’s simple to do…

Removing /index.php/ from Permalinks

In WordPress itself, under Settings –> Permalinks set Common Settings to Custom Structure: /%postname%/

Then, edit your web.config and add the following section to the system.webServer section:

 <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" />
 <action type="Rewrite" url="index.php/{R:0}" />

Your URLs should now be rewritten as the much more friendly format. For more how-to guide and content like this, read our blog.

John Biswell

Operations Director

John is Operations Director at Secura and a Windows Server expert. Before all things IIS related, he was also a champion powerlifter.

Tweet me at: