Remove index.php in permalink structure on IIS server

In permalinks(dashboard) section index.php added.
e.g.

Current Post Name: http://zakatchicago.com/index.php/sample-post/
Expected Post Name: http://zakatchicago.com/sample-post/

How can i remove index.php?

Note: I am using windows server

2 s
2

According to the documentation here: http://www.iis.net/learn/extensions/url-rewrite-module/enabling-pretty-permalinks-in-wordpress

I assume you have already selected Post Name in your permalink structure:

Then include this code in web.config

<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" />
    </rule>
</rules>
</rewrite>

Leave a Comment