Skip to content

Instantly share code, notes, and snippets.

@richardbenson
Created April 26, 2010 19:21
Show Gist options
  • Save richardbenson/379760 to your computer and use it in GitHub Desktop.
Save richardbenson/379760 to your computer and use it in GitHub Desktop.
<rule name="www.example.com" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll">
<add input="{HTTP_HOST}" pattern="^www.example.com" />
<add input="{REQUEST_FILENAME}" matchType="IsFile" />
</conditions>
<action type="Rewrite" url="/site-files/example_com/{R:0}" />
</rule>
<rule name="Image Cache" stopProcessing="true">
<match url="^assets/cache/([0-9]+)/([0-9]+)/(.+)" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
</conditions>
<action type="Rewrite" url="asset-cache.aspx?width={R:1}&amp;height={R:2}&amp;filename={R:3}" />
</rule>
<rule name="Other Assets" stopProcessing="true">
<match url="^assets/cache/(.+)" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
</conditions>
<action type="Rewrite" url="asset-cache.aspx?filename={R:1}" />
</rule>
<rule name="Rewrite All" stopProcessing="true">
<match url="^(.*)$" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="dynamic.asp" />
</rule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment