Skip to content

Instantly share code, notes, and snippets.

@Zmoki

Zmoki/web.config Secret

Created November 16, 2012 12:53
Show Gist options
  • Select an option

  • Save Zmoki/4087120 to your computer and use it in GitHub Desktop.

Select an option

Save Zmoki/4087120 to your computer and use it in GitHub Desktop.
IIS config for MODx Revolution
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="ModX IIS7 Rule 1 (By Simon Fraser)" stopProcessing="true">
<match url=".*" ignoreCase="false" />
<conditions logicalGrouping="MatchAll">
<add input="{HTTP_USER_AGENT}" pattern="^.*internal\ dummy\ connection.*$" />
</conditions>
<action type="CustomResponse" statusCode="403" statusReason="Forbidden" statusDescription="Forbidden" />
</rule>
<rule name="ModX IIS7 Rule 2 (By Simon Fraser)" stopProcessing="true">
<match url="^(connectors|core|manager|assets)" ignoreCase="false" />
<action type="None" />
</rule>
<rule name="ModX IIS7 Rule 3 (By Simon Fraser)" stopProcessing="true">
<match url="^(.*)$" ignoreCase="false" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" pattern="" ignoreCase="false" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" pattern="" ignoreCase="false" />
</conditions>
<action type="Rewrite" url="index.php?q={R:1}" appendQueryString="true" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment