I'm looking for a solution for a subdomain catch-all url in IIS Express.
Basically, I've looked around and found how to create domains/subdomains in IIS Express.
It was quite easy to find, and all I had to do was add another binding in the ApplicationHost.config for IIS Express, and change my hosts file to point 127.0.0.1 to the domain.
This is the IIS express config file:
<binding protocol="http" bindingInformation="*:80:domain.com" />
<binding protocol="http" bindingInformation="*:80:sub.domain.com" />
However, I couldn't find any way to create a catch-all URL. There might have been an over-sight from me somewhere, I even tried (maybe naively) *:80:*.domain.com
and *:80:*
.
Another question that I've searched but couldn't an answer to is binding IIS express to a catch-all url completely (as in, every request should pass through IIS Express for a specific port).
If it matters I'm using an ASP.NET MVC 3 application.
Unfortunately, I don't believe this is possible, because IIS does not support wildcard domains. The following sites detail potential workarounds.
http://forums.iis.net/t/1095760.aspx
https://serverfault.com/questions/165660/wildcard-subdomains-on-localhost-using-iis7
Wildcard subdomains in IIS7. Is it possible to make them like it is in Apache?
The following article explains how IIS bindings work. In relation to your second question, the article states:
The shortest possible binding is reserved for servers with a single IP and site, or if you wish to have a “catch-all” site when no other binding fits. This binding, which uses the IP wildcard and no host header, would be applied absolutely last when no other binding match could be found. In this case the binding will simply be:
http *:80:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With