Click here to Skip to main content
15,893,790 members

Comments by Himadri Majumdar (Top 1 by date)

Himadri Majumdar 13-Nov-13 4:09am View    
In that case actually you have no need to physically create sub-domain. You can use Application Request Routing Module 2 to achieve the same. You just need to add one rule which does what you wanted to do. If I understand it correctly you want below cases.

www.abc.mydomain.com -> www.mydomain.com/abc
abc.mydomain.com -> www.mydomain.com/abc
www.xyz.mydoamin.com -> www.mydomain.com/xyz
xyz.mydomain.com -> www.mydomain.com/xyz

You can follow http://forums.iis.net/t/1155754.aspx

<rule name="SubDomainRedirect" stopprocessing="false">
<match url="(.*)">
<conditions>
<add input="{HTTP_HOST}" pattern="^(?!www)(\w+)\.mydomain\.com$">

<action type="Rewrite" url="{C:1}/{R:1}">