Reputation: 4864
I want to set www.domain.com/folder
as folder.domain.com
. Both must run as same application.
Upvotes: 1
Views: 154
Reputation: 8521
Add following rule in your web.config file -
<system.webServer>
<rewrite>
<rules>
<rule name="FolderSubDomain" stopProcessing="false">
<match url="(.*)" />
<conditions>
<add input="{HTTP_HOST}" pattern="^(?!www)(\w+)\.domain\.com$" />
</conditions>
<action type="Rewrite" url="{C:1}/{R:1}" />
</rule>
</rules>
</rewrite>
</system.webServer>
Upvotes: 1