title: IIS Rewrite Module Subdomain
body: <p>Im working on a new website for a customer.
  The site is hosted in Episerverhosting.com.</p>
  
  <p>They have today public sub-domains such as (example)</p>
  
  <ul>
  <li>digital.nor.se </li>
  <li>customer.nor.se</li>
  </ul>
  
  <p>hosted on wordpress or something.</p>
  
  <p>and the main site:</p>
  
  <ul>
  <li>www.nor.se</li>
  </ul>
  
  <p>I need to redirect <a href="http://digital.nor.se" rel="nofollow noreferrer">http://digital.nor.se</a> to www.nor.se/parent/child/granchild</p>
  
  <p>So when we go public and www.nor.se get pointed to our new episerver site i need to check for sub-domain and redirect to pages at the main website.</p>
  
  <p>When i RDP to our server this is how the IIS is configured:</p>
  
  <ul>
  <li>only one site in iis named nor.se </li>
  <li>only one site binding for IP-address *</li>
  </ul>
  
  <p>So as in my understanding the * binding will answer for all request.</p>
  
  <p>Is it possible to use Url Rewrite to set up rules that check for sub-domains and redirect. I tried this:</p>
  
  <p><strong>Using:</strong> Regular Expressions</p>
  
  <p><strong>Pattern:</strong> (.*)</p>
  
  <p><strong>Conditions:</strong>(digitalinsights).nor.episerverhosting.com$</p>
  
  <p><strong>Action type:</strong> Redirect</p>
  
  <p>Does not work.
  Have you an example for a better pattern that check for a specific sub-domain?maybe something like:
  (digitalinsights).(whatever?) - </p>
  
  <p>I tried this on my local machine.
  Where instead of * as site binding i added for example
  digital.nor.local¨
  customer.nor.local
  and added it in the hosts file.</p>
  
  <p>this did work.</p>
  
  <p>But i would like to <strong>not</strong> add new site bindings on the episerver hosting server. </p>
  
  <p>I would be glad for help.</p>
  
  <p>BR</p>