Drupal clean URLs on IIS 7

To get Clean URLs working on IIS 7, install the new URL rewriter module (x86, x64) and add the following to the system.webServer section of the sites' web.config:

  1. <rewrite>
  2.   <rules>
  3.     <rule name="Drupal clean URLs" enabled="true">
  4.       <match url="^(.*)$" ignoreCase="false" />
  5.       <conditions logicalGrouping="MatchAll">
  6.         <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
  7.         <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
  8.         <add input="{REQUEST_URI}" negate="true" pattern="/favicon.ico" />
  9.       </conditions>
  10.       <action type="Rewrite" url="index.php?q={R:1}" appendQueryString="true" />
  11.     </rule>
  12.   </rules>
  13. </rewrite>

You also need to install a hotfix to correct REQUEST_URI behaviour when using PHP via the FastCGI module. See KB954946 for more information. A symptom of this problem is when all form submissions get redirected to the frontpage of the site.

Average: 4.5 (2 votes)