title: URL Redirection for localhost With IIS Express
body: <p><strong>Environment :</strong> Development</p>
  
  <p><strong>Technologies Used :</strong> ASp.Net MVC 3, ASp.Net Web Forms, IIS Express, VS 2010 SP1.</p>
  
  <p><strong>Scenario :</strong> </p>
  
  <p>We have implemented separate website module as actual separate .Net solutions. eg. </p>
  
  <ul>
  <li>For User Account related features, site runs at localhost:7080/. </li>
  <li>For search, site runs at localhost:7020/ </li>
  <li>And a project holding common UI element runs at localhost:7090. </li>
  <li>While our main site using all these separate modules runs at localhost:8000. This is the only application which is in ASp.Net webforms (it's legacy code.)</li>
  </ul>
  
  <p>This setting allow us to deploy only required module(s) in production.</p>
  
  <p>In production, these sites has urls like,</p>
  
  <p>www.example.com/account</p>
  
  <p>www.example.com/search</p>
  
  <p>www.example.com/common</p>
  
  <p>Each of these project is actually a separate website in IIS and a redirect engine redirects the URL to appropriate website.</p>
  
  <p><strong>Problem :</strong> </p>
  
  <p>All is good and fine in production, the challenge is only in development environment. We cannot use full IIS due to restrictions from system admin teams (humph) and have to use IIS Express.</p>
  
  <p>What we want is to achieve this,</p>
  
  <p>[http://]localhost:8000/useraccount redirects to [http://]localhost:7020</p>
  
  <p>[http://]localhost:8000/search redirects to [http://]localhost:7080</p>
  
  <p>etc. In short we want to mimic our production environment.</p>
  
  <p>So is there any suggestion about what kind of URL redirection I can use to achieve this ? I did a fair bit of research but couldn't figure out a solution.</p>