Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IIS Express catch-all Subdomain url

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.

like image 549
Linkgoron Avatar asked Apr 10 '11 16:04

Linkgoron


1 Answers

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:

like image 171
Garett Avatar answered Sep 23 '22 04:09

Garett