title: Setting localhost alias in IIS Express for Visual Studio
body: <p>I'm trying to define an alias to localhost in development ambient in Visual Studio 2013.</p>
  
  <p>When I used previous versions of Visual Studio, I used the Visual Studio Development Server to debug and the only thing I needed to do was to change my hosts file adding this entry:</p>
  
  <pre><code>127.0.0.1   localhost    
  127.0.0.1   localhostalias
  </code></pre>
  
  <p>I'm having problems to do this with VS2013. I've browsed all over the internet and I've tried the following things, but I'd like someone of you to tell me what am I doing wrong. I've obviously already changed the hosts file...</p>
  
  <p>In the web project Properties -> Web in the section Servers where IIS Express is selected as default, I tried changing <code>http://localhost:53944</code> to <code>http://localhostalias:53944</code> but an error is showed saying: "<code>Unable to create the virtual directory. Cannot create the Web site 'http://localhostalias:53944'. You must specify "localhost" for the server name</code>".</p>
  
  <p>I also tried changing the applicationhost.config which is located in &lt;>\IISExpress\config to </p>
  
  <pre><code>        &lt;site name="&lt;&lt;Site name&gt;&gt;" id="2"&gt;
              &lt;application path="/" applicationPool="Clr4IntegratedAppPool"&gt;
                  &lt;virtualDirectory path="/" physicalPath="&lt;&lt;Site Path&gt;&gt;" /&gt;
              &lt;/application&gt;
              &lt;bindings&gt;
                  &lt;binding protocol="http" bindingInformation="*:53944:*" /&gt;
              &lt;/bindings&gt;
          &lt;/site&gt;
  </code></pre>
  
  <p>And when I opened the project it was changed to</p>
  
  <pre><code>        &lt;site name="&lt;&lt;Site name&gt;&gt;" id="2"&gt;
              &lt;application path="/" applicationPool="Clr4IntegratedAppPool"&gt;
                  &lt;virtualDirectory path="/" physicalPath="&lt;&lt;Site Path&gt;&gt;" /&gt;
              &lt;/application&gt;
              &lt;bindings&gt;
                  &lt;binding protocol="http" bindingInformation="*:53944:*" /&gt;
              &lt;/bindings&gt;
          &lt;/site&gt;
          &lt;site name="&lt;&lt;Site name&gt;&gt;(1)" id="3"&gt;
              &lt;application path="/" applicationPool="Clr4IntegratedAppPool"&gt;
                  &lt;virtualDirectory path="/" physicalPath="&lt;&lt;Site Path&gt;&gt;" /&gt;
              &lt;/application&gt;
              &lt;bindings&gt;
                  &lt;binding protocol="http" bindingInformation="*:53944:localhost" /&gt;
              &lt;/bindings&gt;
          &lt;/site&gt;
  </code></pre>
  
  <p>Can someone help me?</p>
  
  <p>Thanks in advance,</p>
  
  <p>Camilo</p>