ASP MVC \ Subdomains on Localhost
<p>I'm testing a ASP MVC EF application.. with IIS Express locally. I'm trying to determine the subdomain in the HTTP request but I receive a "Bad Request - Invalid Hostname" error</p>

<p>I've looked at some of the answers about changing the host file but that did not resolve the error.</p>

<p>In my HomeController I have this method to simply print the requesting URL</p>

<blockquote>
  <p>public string Index() { var hn = Request.Headers["HOST"]; return
  hn.ToString(); }</p>
</blockquote>

<p>when viewing localhost -> the page loads</p>

<p>when viewing tenant1.localhost -> Bad Request</p>

<p>Would appreciate if someone can point me in the right direction to resolve this error.</p>

<p>Thanks!</p>