How to Remove index.php on IIS

Web Config for ExpressionEngine

To Remove index.php from ExpressionEngine URLs when using IIS7 do the following:

1. If one isn't there already, create a web.config file in the website's root directory.

2. If you are creating a new web.config file then the following code should work:

< rule name="Default document rewrite" stopProcessing="true">
 < match url="(.*)index.php" />
 < action type="Redirect" url="{R:1}" redirectType="Permanent" />
< /rule>

Note: remove the spaces after the chevrons at the beginning - we included them to make the above example display.

If there is already a web.config file in the root directory then you only need to add the rewrite rule section.

3. In ExpressionEngine go to Admin -> General Configuration and delete the name of your site's index page
(usually "index.php") in the "Name of your site's index page" field and select submit.

That's it - URL rewriting should be working in the same way as using .htaccess on Apache.