Skip to content

Instantly share code, notes, and snippets.

@muhammadghazali
Created November 17, 2012 10:19
Show Gist options
  • Save muhammadghazali/4094686 to your computer and use it in GitHub Desktop.
Save muhammadghazali/4094686 to your computer and use it in GitHub Desktop.
IIS rewrite rules to remove index.php. I created this gist based on: http://stackoverflow.com/a/9965392/1061371
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<httpErrors errorMode="Detailed" />
<asp scriptErrorSentToBrowser="true"/>
<rewrite>
<rules>
<rule name="Rule" stopProcessing="true">
<match url="^(.*)$" ignoreCase="false" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
<add input="{URL}" pattern="^/favicon.ico$" ignoreCase="false" negate="true" />
</conditions>
<action type="Rewrite" url="index.php/{R:1}" appendQueryString="true" />
</rule>
</rules>
</rewrite>
</system.webServer>
<system.web>
<customErrors mode="Off"/>
<compilation debug="true"/>
</system.web>
</configuration>
@rajeshwarbony
Copy link

hey buddy thanks. I lost 4 hour to solve this problem on my godaddy server. thanks for your help. keep helping to others. again thanks.

@dilekiolsun
Copy link

How can i write "index.php/{R:1}" on php

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment