Elgg and IIS

When installing on IIS, the problem is that the Apache mod_rewrite rules will not be recognized, and this breaks the application. You need to convert the mod_rewrite rules to the IIS URL Rewrite module format.

You can do this using the IIS 7+ management console, and the "Import Rules" feature that will do the conversion, as describe in the tutorial "importing Apache mod_rewrite rules".

For your convenience, here is the ruleset converted from Elgg 1.7.3. You need to add these rules to the <system.webServer> section in your web.config file.

<rewrite>
  <rules>
    <rule name="Imported Rule 1">
      <match url="^action/([A-Za-z0-9_/-]+)$" ignoreCase="false" />
      <action type="Rewrite" url="engine/handlers/action_handler.php?action={R:1}&{QUERY_STRING}" appendQueryString="false" />
    </rule>
    <rule name="Imported Rule 2">
      <match url="^services/api/([A-Za-z0-9_-]+)/(.*)$" ignoreCase="false" />
      <action type="Rewrite" url="engine/handlers/service_handler.php?handler={R:1}&request={R:2}&{QUERY_STRING}" appendQueryString="false" />
    </rule>
    <rule name="Imported Rule 3">
      <match url="^export/([A-Za-z]+)/([0-9]+)$" ignoreCase="false" />
      <action type="Rewrite" url="services/export/handler.php?view={R:1}&guid={R:2}" appendQueryString="false" />
    </rule>
    <rule name="Imported Rule 4">
      <match url="^export/([A-Za-z]+)/([0-9]+)/$" ignoreCase="false" />
      <action type="Rewrite" url="services/export/handler.php?view={R:1}&guid={R:2}" appendQueryString="false" />
    </rule>
    <rule name="Imported Rule 5">
      <match url="^export/([A-Za-z]+)/([0-9]+)/([A-Za-z]+)/([A-Za-z0-9_]+)/$" ignoreCase="false" />
      <action type="Rewrite" url="services/export/handler.php?view={R:1}&guid={R:2}&type={R:3}&idname={R:4}" appendQueryString="false" />
    </rule>
    <rule name="Imported Rule 6">
      <match url="^_css/css.css$" ignoreCase="false" />
      <action type="Rewrite" url="_css/css.php" />
    </rule>
    <rule name="Imported Rule 7">
      <match url="^pg/([A-Za-z0-9_-]+)/(.*)$" ignoreCase="false" />
      <action type="Rewrite" url="engine/handlers/pagehandler.php?handler={R:1}&page={R:2}&{QUERY_STRING}" appendQueryString="false" />
    </rule>
    <rule name="Imported Rule 8">
      <match url="^pg/([A-Za-z0-9_-]+)$" ignoreCase="false" />
      <action type="Rewrite" url="engine/handlers/pagehandler.php?handler={R:1}&{QUERY_STRING}" appendQueryString="false" />
    </rule>
    <rule name="Imported Rule 9">
      <match url="xml-rpc.php" ignoreCase="false" />
      <action type="Rewrite" url="engine/handlers/xml-rpc_handler.php" />
    </rule>
    <rule name="Imported Rule 10">
      <match url="mt/mt-xmlrpc.cgi" ignoreCase="false" />
      <action type="Rewrite" url="engine/handlers/xml-rpc_handler.php" />
    </rule>
    <rule name="Imported Rule 11">
      <match url="^tag/(.+)/?$" ignoreCase="false" />
      <action type="Rewrite" url="engine/handlers/pagehandler.php?handler=search&page={R:1}" appendQueryString="false" />
    </rule>
  </rules>
</rewrite>

Search docs