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…
In WordPress itself, under Settings –> Permalinks set Common Settings to Custom Structure: http://yourwebsite.com /%postname%/
Then, edit your web.config and add the following section to the system.webServer section:
<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>
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 is Operations Director at Secura and a Windows Server expert. Before all things IIS related, he was also a champion powerlifter.
Tweet me at:
@securacloud