Skip to content

Instantly share code, notes, and snippets.

@sakapon
Last active March 12, 2016 09:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sakapon/a5a3f9b46ab7488ee2b3 to your computer and use it in GitHub Desktop.
Save sakapon/a5a3f9b46ab7488ee2b3 to your computer and use it in GitHub Desktop.
URL Rewrite to use virtual directories
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="subdomains" stopProcessing="true">
<match url="^(.*)$" />
<conditions>
<add input="{HTTP_HOST}" pattern="www.saka-pon.net" negate="true" />
<add input="{HTTP_HOST}" pattern="^([^.]+).saka-pon.net$" />
</conditions>
<action type="Rewrite" url="{C:1}/{R:1}" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment