I want wildcard subdomains, which is not currently possible. I have heard all kind of arguments, all terrible.
-The HTTP 1.0 or 1.1 specfication wont don’t allow wildcard host headers
FACT IS: This is a configuration setting related to IIS and how to resolve a given hostname to a website. This has nothing to do with HTTP specification, but is strictly an internal matter on how the web server handle requests.
-This is a DNS issue
FACT IS: Mapping a wildcard record to a single IP is a DNS issue, but mapping multiple hosts to one website is a web server issue and has nothing to do with the DNS configuration, even though it requires proper DNS configuration.
Why would IIS not even yet support wildcard host headers? With current IPv4 limitations it is not possible to have one IP address for each website. It is a must, that the webserver are able to handle these matters.
There is no good argument not to integrate proper wildcard support in IIS. It is only a question of lazyness and restrictions, which aren’t necessary for any reason.
Why would IIS not even yet support wildcard host headers? With current IPv4 limitations it is not possible to have one IP address for each website. It is a must, that the webserver are able to handle these matters.
There is no good argument not to integrate proper wildcard support in IIS. It is only a question of lazyness and restrictions, which aren’t necessary for any reason.
Please let the webserver support this.
IIS does support multiple host headers. it is possible to host multiple websites(all pointing to same IP Address) in IIS.
I repeat "wildcard host headers". This means all *.example.com maps to a single website where *.example.org could map to a different website, even though both DNS records resolves to the same IP.
There are many different reasons for using a heavy load of subdomains and none, and it all requires, that you don't have to add all these manually (or by scripting).
That is correct. With IIS6, using something like ISAPI-Rewrite or your own custom redirect logic made using a wildcard DNS entry a dream. If you have a shared account someplace (which provides a static IP) and pointing a wildcard to your ip. You could
have as many sub-domains without making any DNS updates. We use this at ORCS Web, and it makes things a lot easier.
IIS7 should work pretty much the same way, however you can do a lot more magic without all the work. The integrated pipeline makes this dropdead simple from a dev perspective. You can munge URL's all you want.
This issue isn't posted to get temporary and bad fixes. It is raised to give attention to an ongoing problem with the both old IIS versions as well as the newest 7.0. It is brought up in hope for a extension to future versions allowing wildcard hostname as
all other webservers.
As of this writing, the amount of registered .com-domains equals nearly 65 million. If we substract broadcast addresses and other network necessities and includes reserved networks, the .com-domains alone would require min. 2-3 % of all IPv4 ranges. This emphasize
that it is not and will never be an sollution to have one IP address per website. Not all websites need this feature, but it is waste of IP adresses to just apply them, where better solutions are possible. In addition hereto, the amount of domains in total
would easily triple the amount of .com-domains if not more.
My prayer is: The Microsoft IIS development team, please implement proper support for wildcard host headers. It isn't forbidden in any way and it is possible to do while still remaining strict HTTP conformance.
Also i repeat, that this is not a DNS issue. Wildcard host headers also requires the same wilcard A record as the current "solution" does. Therefore this is completely irrelevant for the discussion as well as the solution.
ISAPI-Rewrite offers redirects, but this is not the same as true support. There is a remarkably difference in the advantages gained from pseudo redirect and proper access to correct HTTP_HOST name values and so on. If you call this a solution, a solution could
also be to use a different webserver. These are not solutions and does not deal with the reason for IIS not to support something, which is widely used.
But this has nothing to do with specification. It is usability, administration and convenience. The specification includes nothing about multiple host headers (which is possible) or many other of the features supported (scripting, virtual directories and
so on).
The HTTP specification describes the rules of the web server to communicate with clients - not how the web server should be made or act internally.
Well, that is the beauty of a specification. There are no other perspectives than the specification, and it is not part of the specification how the server internally maps a request to a specific website. Remember; if I enter the address http://blabla.example.com/
the headers sent to IIS would be exactly the same even if the server supports wildcard host headers. There will be no difference whatsoever in the action. If I manually has added blabla.example.com to the website or if IIS support *.example.com has no matter
for both the user and the specification. It is strictly an internally decision.
If you really believes, that it is part of the specification (where as I would point your attention to the RFC 2616, so you could read for yourself), why would you allow IIS to support multiple host headers? This is not a part of the specification. Having
more than one website pr. server isn't either. These are features of the server, which not breaks specification compliance but more the software more attractive. As I said, virtual directories, server includes aren't part of specification either, but they
are for sure nice to have - like ASP.NET, which has nothing to do with core HTTP either.
As far as I know, the Apache team is very strict when it come to protocol compliance, and they support it. Unfortunately, Apache is not an option - if it were, I would have made the change long ago. IIS need to support common used features. To emphasize
this argument, I know several hosting centers who choose Apache over IIS - not because of cost, they still use Windows - as many of their clients have need for wildcard host headers.
Also note, that you wont have to use this, if IIS implements it.
Yeah, keyword - nice to have. I'm sure MS heard your feedback here. As of now, IIS 7 don't support this, it is up to the team to decide, if you have strong support case, I'm sure they will consider in future, etc.
We heard this request a couple of times during the last years. Unfortunately it never never made the top priority list. We are close to the finish line with IIS7 - the last small features go in as we speak, i.e. wildcard domain names won't make it into IIS7.
The only way to do this (as far as I see it) is to get a dedicated IP address and route *.example.com to this IP address.
Sorry,
Thomas Deml
Group Program Manager
Internet Information Services
Microsoft Corp.
it's a pain that today IIS still doesn't support wildcard host header names. because of this, we can't provide our 12'000+ users with their proper subdomain on our service (username.mydomain.com). instead of they get http://mydomain.com/users/username
no, it's neither a DNS issue nor a "get your own ip" thing. we have one single ip for historical reasons and we're running a couple of websites on it.
is there a isapi filter that solves this matter? no just a simple redirect, but a way that permits us to know the original hostname from within asp.net. wouldn't be a problem with apache, but IIS seems to be stuck back in the 90ies.
I would probably recommend option #3 if you have ASP.NET developers, otherwise #2 is probably a nice clean solution. You set a wildcard DNS entry, create your folders then have one httpd.ini file to manage.
As Tomas says:
" is to get a dedicated IP address and route *.example.com to this IP address"
yes. That's the dns part. Then in IIS you create a site with NO host header ( = the default website) for that IP. This indeed works - I have a few weeks ago created such a beast - but the consequences are:
(since it relies on the default website per ip)
1. I can just have one "wildcard subdomain site" per IP (I can have additional regular hostheader specified sites on the same ip, yes, but of course just one "default" website)
2. The risk of being "hijacked". Actually happened to my site. Serverside I did some parsing to get the subdomain part out and rewrote the url <user>.domain.com -> /user.aspx?id=<user>
However I never verified that the MAIN domain part was indeed mine. What can happen:
If someone buys a "dirtyname" domain and simply points it to *your* IP.
Result: a duplicate of your site content is being served (still from your very own server) but under a nasty domain name. Which might be a problem...
What happened to me and my brand new site was that the guy owning the other domain had misconfigured a DNS entry (and pointed a subdomain host of it to my ip).
It was innocent but still...
Personally I really think this should get prioritized by IIS team (i.e being able to specify wildcard in hostheader) - while not being a showstopper for me, it sure is one of these things making you look towards Apache/Mod_AspDotNet
We are hosting a couple instances of DNN each with multiple portals. Each instance is setup on distinct IP as default web site. We let DNN figure out which portal to serve up based upon the subdomain(s)--DNN supports multiple aliases per portal. We also
use the host file to create internal shortcut mappings to specific IP and again let DNN work out the intended portal site using alias.
I really do not understand why this feature / must-have is still being dropped... Come on, it shouldn't be that much work for the IIS team, right? But it would help
A LOT...
I've read about this online, as I want to do a simliar thing.
The problem with the "IP" solution is it will only work for one site, on one IIS install, AND someone could register a dodgy domain name and point it to your IP and they'd get your website.
What I have come up with (and waiting on the tests to confirm) is a workaround using ISAPI_Rewrite (which I suspect some of you are using anyway and have a .htaccess file with rules).
Now, my solution is to put a .htaccess file in the root folder of the Default website, something like (might need some tweaking):
Now, not forgetting your * DNS A record. What will happen is a user goes to whatever.mydomain.com and it will go to the IIS server, fail to find a match Host Header wise and will instead return the default website ("Under Construction" page), except with
that .htaccess file and ISAPI-Rewrite it won't display the "Under Construction" page, as it will run this rule in the .htaccess file and instead pull in the equivalent from
www.mydomain.com where more than likely you will have your actual .htaccess file in the root of your www website and where now you can not only specify rules for your
www.domain.com but anything.yourdomain.com
If you don't have a .htaccess file with rules, then you'll just get your
www.mydomain.com website but as subdomain.mydomain.com instead.
Of course if you own the server (VPS or dedicated) you can tweak this "main" rule even more, but that was a generic one I hope shared hosting IIS companies could incorporate. Perhaps with a tagline of "Dynamic Subdomains".
and I'm using $_SERVER['HTTP_X_FORWARDED_HOST'] in my php page, which returns subdomain.mydomain.com you can of course then trim this down to just subdomain for use in your code.
I'm waiting on my host to apply it to a .htaccess file in the Default Website.
I just wanted to add my support for this feature as well. It is going to become a larger and larger issue as more sites offer increased personalization options. Many, if not most, of the DNS providers allow for easy DNS wild cards. It is a shame that
you then get stuck with hacks on the IIS side.
Fortunately I only have one site that requires wild card sub-domains so far, so I'm good for now. However, I fear the second site that needs this is only a couple months away so I'll need a new solution very soon.
agreed, we need this really bad. a lot of confusion in here about what is really being requested, but specifically need to be able to configure a single site (and NOT the default site) to accept wildcards. I see no valid reason this should be difficult to
implement, and would be a huge benefit. I honestly can't believe it's not in there already
I could do it by other mean and not using IIS setting or configuration as it does not allow doing so. In order to do apply below setting, you must have dedicated server or VPS.
Basically if you have hosted yourdomain.com on VPS/dedicated server and you would like to offer your customers to have their own sub domain to access the application than you can follow below steps.
When you type www.yourdomain.com it will work fine without any issue. It will call index.html file that is placed in root directly of yourdomain.com. Say you have keep physical directly name as "dir" on hard drive of VPS or dedicated server. And there is
index.html file in it. So when you open www.yourdomain.com, it will open www.yourdomain.com/index.html
But when you open XYZ.yourdomain.com or abc.yourdomain.com, it actually open under construction page of IIS (by default "issstart.htm" in "wwwroot"). It call default page set for IIS and not for your domain name. This is real problem. And we can correct
it by below way.
What you can do is, you can write below line in "issstart.htm" (It is in "wwwroot" folder) just after tag.
And it will solve the issue. Now all your customers whoever type their own domain names like, Abc.yourdomain.com or xyz.yourdomain.com will be redirected to "abc.yourdomain.com/dir" and "xyz.yourdomain.com/dir" respectively. I know that it append "dir" at
last but can’t help it. That is why I suggest keeping physical directory name responsible for your web site as short as possible. Alternatively you can hide it using URL rewriting if you wish.
Hope this will help.
P.S. Since we are modifying default file of IIS, so this solution can be used when you offer sub domain to your customer for your single site hosted on VPS and dedicated server and not more ?
I want wildcard subdomains, which is not currently possible. I have heard all kind of arguments, all terrible.
@Net_Srak,
I've read this entire thread, and I agree. The "solutions" are no longer acceptable, as IIS continues to lag behind Apache in this regard. +1 for wildcard subdomains being an executive priority in IIS8.
I am another user who would like to see this simple feature prioritized for the next release. The company I work for provides customer portals for ~15 million people spread across ~700 companies. Each company that receives a portal does so through one of multiple
resellers. Each reseller may have their own domain and the resold companies get a sub-domain under their reseller's domain name (e.g. company.resellerdomain.com). It would greatly simplify the administration of our web servers to be able to add a single host
entry for each reseller domain (e.g. *.resellerdomain.com) as we are currently adding around 40 to 50 companies per month. This one feature could save us over $1000 in labor per year and more importantly make the lives of a small team of people that much sweeter.
I could not find a MS Product Feedback directory dedicated to IIS but I'll keep looking around for a place to make a formal feature request. Sincerely, Gary
I'm totaly agree with you
Net_Srak I dont understand why we do choose work around for this must to have feature on IIS .. i'm not doing realy complex web server scenario .. but with my little scenario I need this feature!! Why this is not exist ... I
just want that all my host coming from the domain group4u.ca point to the same WebSite. I have to create each binding for all host is very frustrating! .. And I dont want to knock my head for found a work around for this .. is ridiculous!
I must be missing the obvious requirement for this. In my years of hosting on IIS, the need for hasn't came up. I've done my administration in DNS with wildcard entries. Can some provide their use case for this feature. Is this type of feature used in
bulk hosting?
Scott, wildcards work for mapping all the subdomains of a domain to a single IP. Then, on the server, if you have a website that is exclusively mapped to this matching IP, everything works fine. The problem comes in when you need *.domain.com AND domain2.com
... and maybe several other sites... to all use that same IP.
You don't have to be a large host to do this- if you have a single hosting account with just one IP, and you have more than one TLD, and you want to do something where subdomains are dynamically used on a site, you are stuck. I'm currently stuck with this
myself, and wound up dedicating an extra IP for a single site, which I'd prefer not to have to do. What I'd rather be able to do is configure a site on IIS to be mapped to *.domain.com, regardless of the ip.. etc.
I'm still not getting it. If you created a wildcard DNS entry mapped to the single IP and mapped IIS to that specific IP. You'll have to use something like isapi rewrite or url rewrite to do your magic with sub-domains. If you have other domains wanting
to map this domain to the same IP, you do the same. That seems to meet the requirement, unless I'm wrong. Which wouldn't surprise me.
What is prohibiting you from implementing this type of architecture? 1 single ip (no host headers) and wildcard DNS? If you wanted all domains to a single site, then use the port 80 wildcard then it doesn't matter. So in the scenerio of dedicated hosting,
that would work, in a shared hosting module, you normally only get a single ip (at the hosts I've been involved with at least). :)
I think this solution can work for me .. but the only thing I dont like is that if I config my DNS with Wildcard .. and if my DNS provider support that .. (I will check it) And If I use I Wildcard like that in my DNS : *.exemple.com point to 128.128.128.128
... all subdomain will point to my WebSite .. even if in reality the subdomain doesn't exist. But, with Wildcard at the webserver level .. I can create a A record with an API from my DNS provider.. and my Webserver will be accept all subdomain *.exemple.com
.. So, host that not exist will be return with a 404 not found.. I know I can twick it for reproduce the same with your solution .. but for me I think IIS must to support this feature for other scenario and to be more flexible at this level. Sorry my english
suck I litte bit.. Ju.
Steve, the only shortcoming with that solution is that it forces you to dedicate an IP to a single website. So, if I have 5 websites that all want to use unlimited subdomains, I'll have to use 5 ips. Sure it works, but why waste IP's when IIS could add wildcard
host header handling and let you do all this with just 1 IP (or at least give you the option)
and again - this is already a problem for me. I build lots of web apps, and many of them use a large number of subdomains.
Thanks for the use case, this to me sounds like bulk shared hosting where many accounts go on the same server and share the same IP address. I think GoDaddy does this for one. When someone mentions "wildcard" or lots of sub-domains, are you creating an
CNAME record back to the host record for each sub-domain you want to support? Or are you creating a wildcard DNS entry? When someone tells me "wildcard" domains, that means "whatever" domain name is supported. There still have to be some redirect logic within
the application to support all these sub-domains people are using. Does that sound accurate?
Forgot to mention, I do understand 5 separate accounts, you can't bind "just" the ip address to five separate top level sites in IIS. So yes, you are burning 5 IP addresses. Wonder if ARR would help in a case like this, accept all domains on one and redirect
to a content server on the back end? Might be worth asking in the ARR forum.
Steve, I've already explained that it isn't just bulk hosting, any custom app that wants to use subdomains needs this, as is my case. yes I use dns wildcards, and yes the application uses logic to decide what to do based one which subdomain is used.
I would like to add my support for this feature. I was very surprised when I could not do it because it just seems intuitive.
I think there is some confusion surrounding this feature. This has nothing to do with DNS. Basically, when we go into IIS and create a new "website" we should be able to enter *.example.com as a host name, period. When IIS loads the website, I can then use
ASP.NET to parse the subdomain and authenticate/provide dynamic content based on the subdomain provided. Right now my temporary solution is to have 50 different "websites" for each subdomain all pointed to the same directory using the same application pool.
It works fine for now but it will not scale. I know I can come up with a temporary hack using third party tools, but I would rather not unless absolutely necessary.
Well, before browser is going to hit your server, it needs to know where as in its IP address first, before your asp.net app is able to get the request and parse which 'subdomain' to go. As of now IIS 7.5 still can't accept * as part of host header value.
There are two parts we talking here:
a) host name resolution - DNS part where * is point -> target server IP
b) wildcard host header - IIS part where IIS is able to pick up * as part of the host header value in each website binding info
I understand now the limitation why this feature isn't available. As the internet migrates towards IPV6, scarcity of ip's should disappear, would you agree?
Steve - It would help a little, but that's not a solution.
This is an easy thing for IIS to add, and it should have been there from the start. Ridiculous that it is missing.
(Edit) It's not just an easy thing to add, the plumbing is already there for host header redirection. So just adding a simple wildcard handler, or even a checkbox on a domain "All Subdomains" or similar, when a host entry is made for a website. It would
literally cost nothing to add this feature, and yet it continues to go missing.
I'll let the IIS team indicate if "it's easy to add". I'm looking from a solution perspective, a dns wildcard entry is a solution to map "any" domain name resolves 1/2 have of the issue. The other limitation IIS can't tie to a single ip address with wildcard
with a single ip address on the box. I've not been involved where ips are a limitation (except customers not willing to pay for it). Adding an ip address is a workaround, I will agree with that. It's an acceptable workaround IMO.
I'm done discussing this. By your logic, host header redirects are unecessary too (just throw another IP at the problem). I just hope the IIS team doesn't see it your way.
*NOT* an acceptable workaround.
Sincerely,
The guy who pays for Windows hosting that doesn't do what he needs it to.
That is fine, I don't profess to know everything, I'm just trying to understand all angles. For my own knowledge, when someone mentions host-header redirects, are they using a 3rd party redirect or URL Rewrite to handle the redirects? I'm sure the IIS team
understands this feature and benefits much better than me.
Dear IIS team, please consider wildcard entrys as HostHeaders a top priority for the future.
I'm working for a hoster and oh I don't know how many times we've cursed this damn IIS that it does not support it.
Everyone that tells it's not needed, has obviously never ever worked with apache. it just plain sucks to add a number of hostheaders when one wildcard entry would suffice. It bloats of the config, hinders the visibility and just ends up in more work to
configure it.
btw. the ipv6 argument as a counter to the ip space waste is invalid, as for the next 10 years it will not be feasibly to setup professional services with ipv6 only.
No customer will pay you anything if only 99% of all users can access it. (and i doubt that even in 10 years there will be that many users with a working ipv6 access)
I'd also like to request the IIS team add support for this. I had assumed this feature already existed and was surprised when it didn't work. I honestly came here looking for the correct syntax as I thought I must have had it wrong. I'm pretty shocked this
feature is missing to be honest.
It's also pretty surprising that people come here to argue against adding such a basic feature. It can only make the software better to add it. There's many features in IIS that I don't use, but I wouldn't say they shouldn't be there for that reason. Go
ahead, let them add the feature and if you don't see a case where you'd use it then just don't! Yeah, we all know there's third party ways to accomplish such tasks, but in that regard most of the features in Windows itself are unnecessary.
Common IIS team, obviously there's enough interest in this feature to spend the few minutes adding it!
+1 to please add it i have a web app.. domain.org i want to configure the app to be able to check what sub domain was used.. if that sub domain was used then show its contents. at the moment im having to add bindings to all the "possible" options.. double work..
log into the apps admin. add the sub domains details.. then remote desktop to the server right click add a binding to the site "yetanothersubdomain.domain.org" woulda been easier just adding a binding of " *.domain.org" and let the app take care of the rest
never mind development :P have to keep adding host file links
I've added a feature request for this here: https://connect.microsoft.com/WindowsServerFeedback/feedback/details/722874/wildcard-subdomain-hostheader-support-in-iis-7-5 I should have filed it as a bug report, since any modern webserver should not be lacking
this feature. But, I'm sure MS will ignore this just like the other few things I've yelled about over the years - Nullable Datasets, domains with trailing dots, etc. Trust that I'm not just venting when I say this lock-in has seriously made me consider switching
platforms, and I still may.
I'll add my 2 cents. MCSE since 1997, I've never needed this before and so hadn't thought about it. Have used wildcard DNS entries for years, always had spare IPs to handle them (often I like to let users create their own name and I've always preferred "mysite.acme.com"
to "www.acme.com/mysite").
So, for those still not getting this: Assume I run two separate CMS solutions, "acme.com" and "hostme.com". Both allow the "mysite" scenario above. Both are low volume, and I'm hosting them on a service that's given me ONE outside IP address "9.0.0.1". These
are boutique services and my little shared server is more than adequate to the task.
IIS binding for site "acme CMS": 9.0.0.1, host header "*.acme.com" IIS binding for site "hostme CMS": 9.0.0.1, host header "*.hostme.com"
In my code, I detect the * portion of the incoming header and hit the database accordingly.
Except...IIS won't do this.
Surprised I've never needed this before, astonished that IIS chokes on it. The error message I get when I enter "*.acme.com" as a host header looks like something from the dark ages.
I can conceive of a 3rd site, sitting next to these two, bound to the external IP with no host headers, and with reverse proxy set up (IIS 7.5, URL Rewrite 2.0 and ARR), and using ports 8080 for "acme CMS" with no host headers, and port 8181 for "hostme
CMS" also with no host headers. Yeah, that would work. But it's 2012 and it's silly that I can't type a wildcard into the host header, especially in IIS 7.5, since the re-architecture made URL Rewrite and ARR so easy.
Bottom line: I'm lazy, and so apparently is the IIS team. But I'm the customer so I get to be lazy. :)
I'm afraid we won't see this module within IIS 8 either. It'll have to be an out of band or potentially wait until the next release of IIS.
I can't believe we won´t get this feature in the next version of IIS. I'm speaking for myself and a bunch of colleagues. We've been needing this feature for YEARS, we still need it, and we need it BAD!
And what I can't believe either is the big fuzz about it. *.example.com? Is it really that hard?
And one more thing, we'll continue nagging for it ...
I agree, it's absolutely ludicrous that this isn't supported in IIS. I have had 2 separate instances where this has been required, and they aren't particularly advanced scenarios either... I can't understand for the life of me why such a simple feature has
been ignored for so long!
One usage scenario is simply for Wordpress multisite... Wildcard DNS entries are made and users can sign up for their own subdomain. Very simple scenario that is quite common and is relied on by many services today.
The second usage scenario that I'm trying to sort out now is to create a very simple scrip that grabs the request URI and then makes an HTTP redirect to another subdomain... For instance going from subdomain.example.com to subdomain.example2.com. A simple
mapping script that should take 3 lines of code on an Apache server is quite literally IMPOSSIBLE to implement on an IIS box without having to use up an entire IPv4 address. How is that even possible? How is that an acceptable solution? I mean, it's 2012,
we are running out of addresses, they should be rationed and yet, the IIS team thinks that I should consume an entire address just to perform a simple redirect?
what are you trying to do ? have replied in the other thread on nornal host header setup.
if you need wildcard domain for IIS - say *.yourdomain.com then this is not so much of IIS, as you have tested it can't support * as part of the host header. All you need is to bind the site without any host header value - just dedicated IP and port. then
create a DNS record * and point to the IP. this is more of name resolution - where it gets * all name request and resolve it to your dedicated IP, so when the request reaches IIS, since there is no host header setup, all requests will be handle by that particular
website.
Oh boy, I really can't believe that this feature still hasn't made it into IIS....
@qbernard
the "solution" with the empty HostHeader is no more than a crude workaround, that wastes IP addresses and creates additional adminitrative overhead on the DNS level. (as well as networking, firewall, etc. - if you really take into account what it means to
provide additional IP addresses for servers)
Wildcard subdomains are needed. People misspell www all the time (seriously) and these people will get 403 errors and think that the site is down. Others fail to put www into the address at all. It would not be too hard for IIS to order by TLD, and then
each domain and then to search subdomains, and if there is no exact match, then test wildcards.
Something else that would be helpful is a "This site answers all host headers not otherwise specified" type of request. This would be a default web site. I consider this a vital thing that is missing, and the end result is a high number of 403 responses
to slightly misspelled URLs.
Yeah we all want it but it does not like it will be done.
There are workarounds.
I use separate IPs for wildcard sites and bind to the IP not host headers.
When I look at this on Windows Server 2016 Technical Preview 2, I can finally add a wildcard hostname:
Name ID State Physical Path Bindings
---- -- ----- ------------- --------
Default Web Site 1 Started %SystemDrive%\inetpub\wwwroot http *:80:*.bar.local
and it seems to work.
And I thought there was nothing new in IIS 10 except for HTTP/2 support.
Well that does sound good news. Not used the new Windows server beta yet.
Microsofts iis team (if any are left that are not moved to azure) are doing a poor job giving any information of the features.
This is great news! Downloading the technical preview now. This will make a huge difference for simplifying sites with multiple subdomains and SEO redirects.
5 Posts
Wildcard host header support
Apr 05, 2007 01:24 PM|Net_Srak|LINK
I want wildcard subdomains, which is not currently possible. I have heard all kind of arguments, all terrible.
- The HTTP 1.0 or 1.1 specfication wont don’t allow wildcard host headers
FACT IS: This is a configuration setting related to IIS and how to resolve a given hostname to a website. This has nothing to do with HTTP specification, but is strictly an internal matter on how the web server handle requests.
- This is a DNS issue
FACT IS: Mapping a wildcard record to a single IP is a DNS issue, but mapping multiple hosts to one website is a web server issue and has nothing to do with the DNS configuration, even though it requires proper DNS configuration.
Why would IIS not even yet support wildcard host headers? With current IPv4 limitations it is not possible to have one IP address for each website. It is a must, that the webserver are able to handle these matters.
There is no good argument not to integrate proper wildcard support in IIS. It is only a question of lazyness and restrictions, which aren’t necessary for any reason.
Please let the webserver support this.
5 Posts
Re: Wildcard host header support
Apr 05, 2007 02:07 PM|sethi2000|LINK
IIS does support multiple host headers. it is possible to host multiple websites(all pointing to same IP Address) in IIS.
Check this url to understand "How to user Host Header Names to Configure Multiple Web Sites in Internet Information Services"
5 Posts
Re: Wildcard host header support
Apr 05, 2007 03:46 PM|Net_Srak|LINK
I repeat "wildcard host headers". This means all *.example.com maps to a single website where *.example.org could map to a different website, even though both DNS records resolves to the same IP.
There are many different reasons for using a heavy load of subdomains and none, and it all requires, that you don't have to add all these manually (or by scripting).
7019 Posts
MVP
Re: Wildcard host header support
Apr 06, 2007 12:43 AM|qbernard|LINK
Well, for now all you can do is tweak the dns record and point it to the website with a particular IP. the magic here is not with IIS but DNS.
For more than 1 wildcard domain, as of know I think you can either redirect it via isapi or default page coding.
Bernard Cheah
5619 Posts
Re: Wildcard host header support
Apr 06, 2007 04:58 AM|steve schofield|LINK
That is correct. With IIS6, using something like ISAPI-Rewrite or your own custom redirect logic made using a wildcard DNS entry a dream. If you have a shared account someplace (which provides a static IP) and pointing a wildcard to your ip. You could have as many sub-domains without making any DNS updates. We use this at ORCS Web, and it makes things a lot easier.
IIS7 should work pretty much the same way, however you can do a lot more magic without all the work. The integrated pipeline makes this dropdead simple from a dev perspective. You can munge URL's all you want.
Steve Schofield
Windows Server MVP - IIS
http://iislogs.com/steveschofield
http://www.IISLogs.com
Log archival solution
Install, Configure, Forget
5 Posts
Re: Wildcard host header support
Apr 06, 2007 05:44 PM|Net_Srak|LINK
As of this writing, the amount of registered .com-domains equals nearly 65 million. If we substract broadcast addresses and other network necessities and includes reserved networks, the .com-domains alone would require min. 2-3 % of all IPv4 ranges. This emphasize that it is not and will never be an sollution to have one IP address per website. Not all websites need this feature, but it is waste of IP adresses to just apply them, where better solutions are possible. In addition hereto, the amount of domains in total would easily triple the amount of .com-domains if not more.
My prayer is: The Microsoft IIS development team, please implement proper support for wildcard host headers. It isn't forbidden in any way and it is possible to do while still remaining strict HTTP conformance.
Also i repeat, that this is not a DNS issue. Wildcard host headers also requires the same wilcard A record as the current "solution" does. Therefore this is completely irrelevant for the discussion as well as the solution.
ISAPI-Rewrite offers redirects, but this is not the same as true support. There is a remarkably difference in the advantages gained from pseudo redirect and proper access to correct HTTP_HOST name values and so on. If you call this a solution, a solution could also be to use a different webserver. These are not solutions and does not deal with the reason for IIS not to support something, which is widely used.
Support it. Please!
7019 Posts
MVP
Re: Wildcard host header support
Apr 07, 2007 12:38 AM|qbernard|LINK
Mmm.... pray hard then.
If this is in spec, MS should and will do it.
If it's not... then pray again.
Bernard Cheah
5 Posts
Re: Wildcard host header support
Apr 07, 2007 11:59 AM|Net_Srak|LINK
But this has nothing to do with specification. It is usability, administration and convenience. The specification includes nothing about multiple host headers (which is possible) or many other of the features supported (scripting, virtual directories and so on).
The HTTP specification describes the rules of the web server to communicate with clients - not how the web server should be made or act internally.
7019 Posts
MVP
Re: Wildcard host header support
Apr 08, 2007 11:39 PM|qbernard|LINK
Bernard Cheah
5 Posts
Re: Wildcard host header support
Apr 09, 2007 01:46 PM|Net_Srak|LINK
Well, that is the beauty of a specification. There are no other perspectives than the specification, and it is not part of the specification how the server internally maps a request to a specific website. Remember; if I enter the address http://blabla.example.com/ the headers sent to IIS would be exactly the same even if the server supports wildcard host headers. There will be no difference whatsoever in the action. If I manually has added blabla.example.com to the website or if IIS support *.example.com has no matter for both the user and the specification. It is strictly an internally decision.
If you really believes, that it is part of the specification (where as I would point your attention to the RFC 2616, so you could read for yourself), why would you allow IIS to support multiple host headers? This is not a part of the specification. Having more than one website pr. server isn't either. These are features of the server, which not breaks specification compliance but more the software more attractive. As I said, virtual directories, server includes aren't part of specification either, but they are for sure nice to have - like ASP.NET, which has nothing to do with core HTTP either.
As far as I know, the Apache team is very strict when it come to protocol compliance, and they support it. Unfortunately, Apache is not an option - if it were, I would have made the change long ago. IIS need to support common used features. To emphasize this argument, I know several hosting centers who choose Apache over IIS - not because of cost, they still use Windows - as many of their clients have need for wildcard host headers.
Also note, that you wont have to use this, if IIS implements it.
7019 Posts
MVP
Re: Wildcard host header support
Apr 11, 2007 05:24 AM|qbernard|LINK
Bernard Cheah
538 Posts
Re: Wildcard host header support
Apr 12, 2007 02:00 AM|thomad|LINK
Net_Srak,
We heard this request a couple of times during the last years. Unfortunately it never never made the top priority list. We are close to the finish line with IIS7 - the last small features go in as we speak, i.e. wildcard domain names won't make it into IIS7. The only way to do this (as far as I see it) is to get a dedicated IP address and route *.example.com to this IP address.
Sorry,
Group Program Manager
Internet Information Services
Microsoft Corp.
1 Post
Re: Wildcard host header support
Sep 29, 2007 05:07 AM|ooswald|LINK
it's a pain that today IIS still doesn't support wildcard host header names. because of this, we can't provide our 12'000+ users with their proper subdomain on our service (username.mydomain.com). instead of they get http://mydomain.com/users/username
no, it's neither a DNS issue nor a "get your own ip" thing. we have one single ip for historical reasons and we're running a couple of websites on it.
is there a isapi filter that solves this matter? no just a simple redirect, but a way that permits us to know the original hostname from within asp.net. wouldn't be a problem with apache, but IIS seems to be stuck back in the 90ies.
5619 Posts
Re: Wildcard host header support
Sep 29, 2007 09:46 AM|steve schofield|LINK
If IIS doesn't fit your needs, use Apache. It's about the solution, not the technology. There are a few ways to do it in IIS I can think of off-hand.
1) Create a host-header for each user
2) Create a single site, use www.isapirewrite.com (3rd party rewrite tool) or something similar to redirect to a each users folder.
3) Write your own HTTP Module that rewrites the URL with ASP.NET.
http://weblogs.asp.net/scottgu/archive/2007/02/26/tip-trick-url-rewriting-with-asp-net.aspx
http://weblogs.asp.net/scottgu/archive/2006/01/18/435870.aspx
I would probably recommend option #3 if you have ASP.NET developers, otherwise #2 is probably a nice clean solution. You set a wildcard DNS entry, create your folders then have one httpd.ini file to manage.
Steve Schofield
Windows Server MVP - IIS
http://iislogs.com/steveschofield
http://www.IISLogs.com
Log archival solution
Install, Configure, Forget
1 Post
Re: Wildcard host header support
Oct 01, 2007 02:46 AM|aspcode.net|LINK
As Tomas says:
" is to get a dedicated IP address and route *.example.com to this IP address"
yes. That's the dns part. Then in IIS you create a site with NO host header ( = the default website) for that IP. This indeed works - I have a few weeks ago created such a beast - but the consequences are:
(since it relies on the default website per ip)
1. I can just have one "wildcard subdomain site" per IP (I can have additional regular hostheader specified sites on the same ip, yes, but of course just one "default" website)
2. The risk of being "hijacked". Actually happened to my site. Serverside I did some parsing to get the subdomain part out and rewrote the url <user>.domain.com -> /user.aspx?id=<user>
However I never verified that the MAIN domain part was indeed mine. What can happen:
<user>.DIRTYDOMAINNAME.com -> /user.aspx?id=<user>
If someone buys a "dirtyname" domain and simply points it to *your* IP.
Result: a duplicate of your site content is being served (still from your very own server) but under a nasty domain name. Which might be a problem...
What happened to me and my brand new site was that the guy owning the other domain had misconfigured a DNS entry (and pointed a subdomain host of it to my ip).
It was innocent but still...
Personally I really think this should get prioritized by IIS team (i.e being able to specify wildcard in hostheader) - while not being a showstopper for me, it sure is one of these things making you look towards Apache/Mod_AspDotNet
ASPCode.net
1 Post
Re: Wildcard host header support
Feb 04, 2008 09:49 PM|lmeyers|LINK
We are hosting a couple instances of DNN each with multiple portals. Each instance is setup on distinct IP as default web site. We let DNN figure out which portal to serve up based upon the subdomain(s)--DNN supports multiple aliases per portal. We also use the host file to create internal shortcut mappings to specific IP and again let DNN work out the intended portal site using alias.
15 Posts
Re: Wildcard host header support
May 27, 2009 05:42 AM|kipusoep|LINK
I really do not understand why this feature / must-have is still being dropped... Come on, it shouldn't be that much work for the IIS team, right? But it would help A LOT...
3 Posts
Re: Wildcard host header support
Jul 09, 2009 12:06 PM|AJStevens|LINK
I've read about this online, as I want to do a simliar thing.
The problem with the "IP" solution is it will only work for one site, on one IIS install, AND someone could register a dodgy domain name and point it to your IP and they'd get your website.
What I have come up with (and waiting on the tests to confirm) is a workaround using ISAPI_Rewrite (which I suspect some of you are using anyway and have a .htaccess file with rules).
Now, my solution is to put a .htaccess file in the root folder of the Default website, something like (might need some tweaking):
RewriteEngine on
RewriteCond %{HTTPS} (on)?
RewriteCond %{HTTP_HOST} ^(?!(?:www))([^.]+)\.([^.]+\.[^.]+)$ [NC]
RewriteRule ^([^.]+)?$ http(?%1s)://www.%3/(?1$1) [NC,P,QSA]
Now, not forgetting your * DNS A record. What will happen is a user goes to whatever.mydomain.com and it will go to the IIS server, fail to find a match Host Header wise and will instead return the default website ("Under Construction" page), except with that .htaccess file and ISAPI-Rewrite it won't display the "Under Construction" page, as it will run this rule in the .htaccess file and instead pull in the equivalent from www.mydomain.com where more than likely you will have your actual .htaccess file in the root of your www website and where now you can not only specify rules for your www.domain.com but anything.yourdomain.com
Most commonly you'll want something that does http://username.mydomain.com to pull in data from www.mydomain.com/users.php?user=username for example.
If you don't have a .htaccess file with rules, then you'll just get your www.mydomain.com website but as subdomain.mydomain.com instead.
Of course if you own the server (VPS or dedicated) you can tweak this "main" rule even more, but that was a generic one I hope shared hosting IIS companies could incorporate. Perhaps with a tagline of "Dynamic Subdomains".
iis host header workaround Wildcard
3 Posts
Re: Wildcard host header support
Jul 21, 2009 10:53 AM|AJStevens|LINK
I'm now using this rule:
RewriteEngine on
# subdomains subdomain.domain.com to www.domain.com for futher processing
RewriteCond %{HTTPS} (on)?
RewriteCond %{HTTP_HOST} ^(?!www\.)[^.]+\.([^.]+\.[^.]{2,3}(?:\.[^.]{2,3})?)$ [NC]
RewriteRule (.*) http(?%1s)://www.%2/$1 [P,NC,QSA]
and I'm using $_SERVER['HTTP_X_FORWARDED_HOST'] in my php page, which returns subdomain.mydomain.com you can of course then trim this down to just subdomain for use in your code.
I'm waiting on my host to apply it to a .htaccess file in the Default Website.
1 Post
Re: Wildcard host header support
Oct 05, 2009 12:39 PM|TCost|LINK
I just wanted to add my support for this feature as well. It is going to become a larger and larger issue as more sites offer increased personalization options. Many, if not most, of the DNS providers allow for easy DNS wild cards. It is a shame that you then get stuck with hacks on the IIS side.
Fortunately I only have one site that requires wild card sub-domains so far, so I'm good for now. However, I fear the second site that needs this is only a couple months away so I'll need a new solution very soon.
12 Posts
Re: Wildcard host header support
Oct 14, 2010 03:19 PM|setiri|LINK
agreed, we need this really bad. a lot of confusion in here about what is really being requested, but specifically need to be able to configure a single site (and NOT the default site) to accept wildcards. I see no valid reason this should be difficult to implement, and would be a huge benefit. I honestly can't believe it's not in there already
1 Post
Re: Wildcard host header support
Feb 19, 2011 10:38 AM|dhart.net|LINK
1 Post
Re: Wildcard host header support
Mar 17, 2011 10:37 AM|ashishnarola|LINK
Basically if you have hosted yourdomain.com on VPS/dedicated server and you would like to offer your customers to have their own sub domain to access the application than you can follow below steps.
When you type www.yourdomain.com it will work fine without any issue. It will call index.html file that is placed in root directly of yourdomain.com. Say you have keep physical directly name as "dir" on hard drive of VPS or dedicated server. And there is index.html file in it. So when you open www.yourdomain.com, it will open www.yourdomain.com/index.html
But when you open XYZ.yourdomain.com or abc.yourdomain.com, it actually open under construction page of IIS (by default "issstart.htm" in "wwwroot"). It call default page set for IIS and not for your domain name. This is real problem. And we can correct it by below way.
What you can do is, you can write below line in "issstart.htm" (It is in "wwwroot" folder) just after tag.
And it will solve the issue. Now all your customers whoever type their own domain names like, Abc.yourdomain.com or xyz.yourdomain.com will be redirected to "abc.yourdomain.com/dir" and "xyz.yourdomain.com/dir" respectively. I know that it append "dir" at last but can’t help it. That is why I suggest keeping physical directory name responsible for your web site as short as possible. Alternatively you can hide it using URL rewriting if you wish.
Hope this will help.
P.S. Since we are modifying default file of IIS, so this solution can be used when you offer sub domain to your customer for your single site hosted on VPS and dedicated server and not more ?
20 Posts
Re: Wildcard host header support
Mar 18, 2011 09:07 PM|itisdesign|LINK
@Net_Srak,
I've read this entire thread, and I agree. The "solutions" are no longer acceptable, as IIS continues to lag behind Apache in this regard. +1 for wildcard subdomains being an executive priority in IIS8.
Thanks,
-Aaron Neff
1172 Posts
Re: Wildcard host header support
Mar 21, 2011 10:42 PM|kctt|LINK
You can get away with a dedicated IP. That's the only option for now.
1 Post
Re: Wildcard host header support
Jun 06, 2011 12:30 PM|garyalfred|LINK
7019 Posts
MVP
Re: Wildcard host header support
Jun 06, 2011 09:54 PM|qbernard|LINK
This is fine, the product team is reading this I'm sure.
Heck, relate to this, I haven't seen or heard any insider details about IIS 8..... that's sad :)
Bernard Cheah
2 Posts
Re: Wildcard host header support
Jun 12, 2011 08:17 PM|julien.cousineau|LINK
I'm totaly agree with you Net_Srak I dont understand why we do choose work around for this must to have feature on IIS .. i'm not doing realy complex web server scenario .. but with my little scenario I need this feature!! Why this is not exist ... I just want that all my host coming from the domain group4u.ca point to the same WebSite. I have to create each binding for all host is very frustrating! .. And I dont want to knock my head for found a work around for this .. is ridiculous!
+ 10000 for this feature
Thank you.
5619 Posts
Re: Wildcard host header support
Jun 12, 2011 10:00 PM|steve schofield|LINK
Steve Schofield
Windows Server MVP - IIS
http://iislogs.com/steveschofield
http://www.IISLogs.com
Log archival solution
Install, Configure, Forget
12 Posts
Re: Wildcard host header support
Jun 12, 2011 10:15 PM|setiri|LINK
Scott, wildcards work for mapping all the subdomains of a domain to a single IP. Then, on the server, if you have a website that is exclusively mapped to this matching IP, everything works fine. The problem comes in when you need *.domain.com AND domain2.com ... and maybe several other sites... to all use that same IP.
You don't have to be a large host to do this- if you have a single hosting account with just one IP, and you have more than one TLD, and you want to do something where subdomains are dynamically used on a site, you are stuck. I'm currently stuck with this myself, and wound up dedicating an extra IP for a single site, which I'd prefer not to have to do. What I'd rather be able to do is configure a site on IIS to be mapped to *.domain.com, regardless of the ip.. etc.
Hope that made sense.
5619 Posts
Re: Wildcard host header support
Jun 12, 2011 10:39 PM|steve schofield|LINK
I'm still not getting it. If you created a wildcard DNS entry mapped to the single IP and mapped IIS to that specific IP. You'll have to use something like isapi rewrite or url rewrite to do your magic with sub-domains. If you have other domains wanting to map this domain to the same IP, you do the same. That seems to meet the requirement, unless I'm wrong. Which wouldn't surprise me.
What is prohibiting you from implementing this type of architecture? 1 single ip (no host headers) and wildcard DNS? If you wanted all domains to a single site, then use the port 80 wildcard then it doesn't matter. So in the scenerio of dedicated hosting, that would work, in a shared hosting module, you normally only get a single ip (at the hosts I've been involved with at least). :)
Steve Schofield
Windows Server MVP - IIS
http://iislogs.com/steveschofield
http://www.IISLogs.com
Log archival solution
Install, Configure, Forget
2 Posts
Re: Wildcard host header support
Jun 12, 2011 10:53 PM|julien.cousineau|LINK
12 Posts
Re: Wildcard host header support
Jun 12, 2011 11:10 PM|setiri|LINK
Steve, the only shortcoming with that solution is that it forces you to dedicate an IP to a single website. So, if I have 5 websites that all want to use unlimited subdomains, I'll have to use 5 ips. Sure it works, but why waste IP's when IIS could add wildcard host header handling and let you do all this with just 1 IP (or at least give you the option)
and again - this is already a problem for me. I build lots of web apps, and many of them use a large number of subdomains.
5619 Posts
Re: Wildcard host header support
Jun 13, 2011 03:48 AM|steve schofield|LINK
Thanks for the use case, this to me sounds like bulk shared hosting where many accounts go on the same server and share the same IP address. I think GoDaddy does this for one. When someone mentions "wildcard" or lots of sub-domains, are you creating an CNAME record back to the host record for each sub-domain you want to support? Or are you creating a wildcard DNS entry? When someone tells me "wildcard" domains, that means "whatever" domain name is supported. There still have to be some redirect logic within the application to support all these sub-domains people are using. Does that sound accurate?
Steve Schofield
Windows Server MVP - IIS
http://iislogs.com/steveschofield
http://www.IISLogs.com
Log archival solution
Install, Configure, Forget
5619 Posts
Re: Wildcard host header support
Jun 13, 2011 03:51 AM|steve schofield|LINK
Steve Schofield
Windows Server MVP - IIS
http://iislogs.com/steveschofield
http://www.IISLogs.com
Log archival solution
Install, Configure, Forget
12 Posts
Re: Wildcard host header support
Jun 13, 2011 10:50 AM|setiri|LINK
3 Posts
Re: Wildcard host header support
Jun 20, 2011 06:45 AM|AJStevens|LINK
I'm in a similiar situation to setri, and I'm also puzzled why this feature is not in IIS yet.
Like setiri, I've looked at ways around it, but they're just too costly (dedicating IPs), and forces me to use alternative web servers.
7019 Posts
MVP
Re: Wildcard host header support
Jun 21, 2011 12:24 AM|qbernard|LINK
Bernard Cheah
1 Post
Re: Wildcard host header support
Oct 05, 2011 12:06 PM|dls775|LINK
I think there is some confusion surrounding this feature. This has nothing to do with DNS. Basically, when we go into IIS and create a new "website" we should be able to enter *.example.com as a host name, period. When IIS loads the website, I can then use ASP.NET to parse the subdomain and authenticate/provide dynamic content based on the subdomain provided. Right now my temporary solution is to have 50 different "websites" for each subdomain all pointed to the same directory using the same application pool. It works fine for now but it will not scale. I know I can come up with a temporary hack using third party tools, but I would rather not unless absolutely necessary.
7019 Posts
MVP
Re: Wildcard host header support
Oct 07, 2011 02:32 AM|qbernard|LINK
Well, before browser is going to hit your server, it needs to know where as in its IP address first, before your asp.net app is able to get the request and parse which 'subdomain' to go. As of now IIS 7.5 still can't accept * as part of host header value.
There are two parts we talking here:
a) host name resolution - DNS part where * is point -> target server IP
b) wildcard host header - IIS part where IIS is able to pick up * as part of the host header value in each website binding info
Bernard Cheah
5619 Posts
Re: Wildcard host header support
Oct 09, 2011 06:29 PM|steve schofield|LINK
Steve Schofield
Windows Server MVP - IIS
http://iislogs.com/steveschofield
http://www.IISLogs.com
Log archival solution
Install, Configure, Forget
12 Posts
Re: Wildcard host header support
Oct 09, 2011 06:33 PM|setiri|LINK
Steve - It would help a little, but that's not a solution.
This is an easy thing for IIS to add, and it should have been there from the start. Ridiculous that it is missing.
(Edit) It's not just an easy thing to add, the plumbing is already there for host header redirection. So just adding a simple wildcard handler, or even a checkbox on a domain "All Subdomains" or similar, when a host entry is made for a website. It would literally cost nothing to add this feature, and yet it continues to go missing.
5619 Posts
Re: Wildcard host header support
Oct 09, 2011 07:35 PM|steve schofield|LINK
Steve Schofield
Windows Server MVP - IIS
http://iislogs.com/steveschofield
http://www.IISLogs.com
Log archival solution
Install, Configure, Forget
12 Posts
Re: Wildcard host header support
Oct 09, 2011 07:45 PM|setiri|LINK
I'm done discussing this. By your logic, host header redirects are unecessary too (just throw another IP at the problem). I just hope the IIS team doesn't see it your way.
*NOT* an acceptable workaround.
Sincerely,
The guy who pays for Windows hosting that doesn't do what he needs it to.
5619 Posts
Re: Wildcard host header support
Oct 09, 2011 08:21 PM|steve schofield|LINK
Steve Schofield
Windows Server MVP - IIS
http://iislogs.com/steveschofield
http://www.IISLogs.com
Log archival solution
Install, Configure, Forget
7019 Posts
MVP
Re: Wildcard host header support
Oct 10, 2011 03:55 AM|qbernard|LINK
Bernard Cheah
4 Posts
Re: Wildcard host header support
Oct 26, 2011 05:42 AM|PeteSmith|LINK
Dear IIS team, please consider wildcard entrys as HostHeaders a top priority for the future.
I'm working for a hoster and oh I don't know how many times we've cursed this damn IIS that it does not support it.
Everyone that tells it's not needed, has obviously never ever worked with apache. it just plain sucks to add a number of hostheaders when one wildcard entry would suffice. It bloats of the config, hinders the visibility and just ends up in more work to configure it.
btw. the ipv6 argument as a counter to the ip space waste is invalid, as for the next 10 years it will not be feasibly to setup professional services with ipv6 only.
No customer will pay you anything if only 99% of all users can access it. (and i doubt that even in 10 years there will be that many users with a working ipv6 access)
7 Posts
Re: Wildcard host header support
Nov 07, 2011 06:37 AM|joelwk|LINK
public Site GetSite(string hostName)
{
hostName = hostName.Replace(hostName.Split(".").First() + ".","");
foreach(var s in GetAllSites())
{
if(s.HostName.Replace("*.","") == (hostName))
return s;
}
}
1 Post
Re: Wildcard host header support
Feb 01, 2012 01:47 PM|TransientTRP|LINK
I'd also like to request the IIS team add support for this. I had assumed this feature already existed and was surprised when it didn't work. I honestly came here looking for the correct syntax as I thought I must have had it wrong. I'm pretty shocked this feature is missing to be honest.
It's also pretty surprising that people come here to argue against adding such a basic feature. It can only make the software better to add it. There's many features in IIS that I don't use, but I wouldn't say they shouldn't be there for that reason. Go ahead, let them add the feature and if you don't see a case where you'd use it then just don't! Yeah, we all know there's third party ways to accomplish such tasks, but in that regard most of the features in Windows itself are unnecessary.
Common IIS team, obviously there's enough interest in this feature to spend the few minutes adding it!
3 Posts
Re: Wildcard host header support
Feb 02, 2012 04:10 AM|WilliamStam|LINK
iis Wildcard host Header
12 Posts
Re: Wildcard host header support
Feb 03, 2012 01:44 AM|setiri|LINK
10 Posts
Re: Wildcard host header support
Feb 23, 2012 12:13 PM|nickelfault|LINK
2 Posts
Re: Wildcard host header support
Apr 22, 2012 03:16 AM|devconcept|LINK
I'll add my 2 cents. MCSE since 1997, I've never needed this before and so hadn't thought about it. Have used wildcard DNS entries for years, always had spare IPs to handle them (often I like to let users create their own name and I've always preferred "mysite.acme.com" to "www.acme.com/mysite").
So, for those still not getting this: Assume I run two separate CMS solutions, "acme.com" and "hostme.com". Both allow the "mysite" scenario above. Both are low volume, and I'm hosting them on a service that's given me ONE outside IP address "9.0.0.1". These are boutique services and my little shared server is more than adequate to the task.
DNS: *.acme.com > 9.0.0.1 DNS: *.hostme.com > 9.0.0.1
IIS binding for site "acme CMS": 9.0.0.1, host header "*.acme.com" IIS binding for site "hostme CMS": 9.0.0.1, host header "*.hostme.com"
In my code, I detect the * portion of the incoming header and hit the database accordingly.
Except...IIS won't do this.
Surprised I've never needed this before, astonished that IIS chokes on it. The error message I get when I enter "*.acme.com" as a host header looks like something from the dark ages.
I can conceive of a 3rd site, sitting next to these two, bound to the external IP with no host headers, and with reverse proxy set up (IIS 7.5, URL Rewrite 2.0 and ARR), and using ports 8080 for "acme CMS" with no host headers, and port 8181 for "hostme CMS" also with no host headers. Yeah, that would work. But it's 2012 and it's silly that I can't type a wildcard into the host header, especially in IIS 7.5, since the re-architecture made URL Rewrite and ARR so easy.
Bottom line: I'm lazy, and so apparently is the IIS team. But I'm the customer so I get to be lazy. :)
1 Post
Re: Wildcard host header support
Jun 07, 2012 12:26 PM|deloreansteel|LINK
devconcept, you hit the nail on the head. +1 of what that person said.
12 Posts
Re: Wildcard host header support
Jun 08, 2012 11:05 AM|setiri|LINK
5619 Posts
Re: Wildcard host header support
Jun 09, 2012 11:34 PM|steve schofield|LINK
Steve Schofield
Windows Server MVP - IIS
http://iislogs.com/steveschofield
http://www.IISLogs.com
Log archival solution
Install, Configure, Forget
12 Posts
Re: Wildcard host header support
Jun 09, 2012 11:36 PM|setiri|LINK
it shouldnt.
5619 Posts
Re: Wildcard host header support
Jun 10, 2012 06:22 AM|steve schofield|LINK
Steve Schofield
Windows Server MVP - IIS
http://iislogs.com/steveschofield
http://www.IISLogs.com
Log archival solution
Install, Configure, Forget
7019 Posts
MVP
Re: Wildcard host header support
Jun 21, 2012 08:28 PM|qbernard|LINK
It is a hot request since many years ago :)
Bernard Cheah
1 Post
Re: Wildcard host header support
Sep 12, 2012 10:40 AM|jeronimo.vargas|LINK
I can't believe we won´t get this feature in the next version of IIS. I'm speaking for myself and a bunch of colleagues. We've been needing this feature for YEARS, we still need it, and we need it BAD!
And what I can't believe either is the big fuzz about it. *.example.com? Is it really that hard?
And one more thing, we'll continue nagging for it ...
7019 Posts
MVP
Re: Wildcard host header support
Sep 16, 2012 11:22 PM|qbernard|LINK
Bernard Cheah
4 Posts
Re: Wildcard host header support
Nov 06, 2012 03:19 PM|CoreM|LINK
I agree, it's absolutely ludicrous that this isn't supported in IIS. I have had 2 separate instances where this has been required, and they aren't particularly advanced scenarios either... I can't understand for the life of me why such a simple feature has been ignored for so long!
One usage scenario is simply for Wordpress multisite... Wildcard DNS entries are made and users can sign up for their own subdomain. Very simple scenario that is quite common and is relied on by many services today.
The second usage scenario that I'm trying to sort out now is to create a very simple scrip that grabs the request URI and then makes an HTTP redirect to another subdomain... For instance going from subdomain.example.com to subdomain.example2.com. A simple mapping script that should take 3 lines of code on an Apache server is quite literally IMPOSSIBLE to implement on an IIS box without having to use up an entire IPv4 address. How is that even possible? How is that an acceptable solution? I mean, it's 2012, we are running out of addresses, they should be rationed and yet, the IIS team thinks that I should consume an entire address just to perform a simple redirect?
Absolutely and totally ridiculous.
7019 Posts
MVP
Re: Wildcard host header support
Nov 11, 2012 11:06 PM|qbernard|LINK
You've got my support for this.
Per info I got, IIS product group is aware of this, it is not a tech issue and the team is pushing for it.
Bernard Cheah
2 Posts
Re: Wildcard host header support
Nov 14, 2012 02:04 PM|devconcept|LINK
7019 Posts
MVP
Re: Wildcard host header support
Nov 16, 2012 02:34 AM|qbernard|LINK
huh? mind to share more info or link? afaik - this is not in 2012 or IIS8
Bernard Cheah
5494 Posts
MVP
Moderator
Re: Wildcard host header support
Nov 16, 2012 06:58 AM|Rovastar|LINK
I have never heard of this either and realise the need for it. Infact I would have prefered it to the other improvements.
I haven't used IIS8 enough but not noticed any feature like this and I would have thought it would be announced.
https://www.leansentry.com/
20 Posts
Re: Wildcard host header support
Nov 21, 2012 02:57 AM|itisdesign|LINK
Amazon EC2 w/o VPC supports *only* 1 public IP. Two issues:
1) What if one site needs an SSL cert and one doesn't?
2) What if each site needs its own (non-shared) SSL cert?
Does IIS8 offer a solution yet?
Thanks,
-Aaron Neff
5494 Posts
MVP
Moderator
Re: Wildcard host header support
Nov 21, 2012 08:39 AM|Rovastar|LINK
SSL is seperate case and not related to this thread - which is about wildcards for hostheaders unsupported in IIS.
SSL is based on the IP address. If you need muiltiple sites with different SSLs you need multiple IPs.
The issue is with Amazons EC2 policy/package.
https://www.leansentry.com/
20 Posts
Re: Wildcard host header support
Nov 21, 2012 12:57 PM|itisdesign|LINK
@Rovastar, You're right - forgot about the host header being encrypted. Pls disregard. Thanks, -Aaron
6 Posts
Re: Wildcard host header support
Dec 29, 2012 11:47 AM|anujrathi|LINK
I was struggling since last 2 hours & finally what I got.
"IIS doesn't provide this feature".
One more thing, when I tried to enter *.mysite.com in website binding section, I got a message:
The host name must be a valid host name format & cannot contain the following characters:
/\[]:|<>+=;,?$%#@{ }^".
But MS haven't denied for ( * ). I haven't enter any of above character, But IIS says that I have entered invalid string value.
--
Anuj Rathi
7019 Posts
MVP
Re: Wildcard host header support
Jan 01, 2013 08:20 PM|qbernard|LINK
what are you trying to do ? have replied in the other thread on nornal host header setup.
if you need wildcard domain for IIS - say *.yourdomain.com then this is not so much of IIS, as you have tested it can't support * as part of the host header. All you need is to bind the site without any host header value - just dedicated IP and port. then create a DNS record * and point to the IP. this is more of name resolution - where it gets * all name request and resolve it to your dedicated IP, so when the request reaches IIS, since there is no host header setup, all requests will be handle by that particular website.
Bernard Cheah
4 Posts
Re: Wildcard host header support
Jan 04, 2013 05:26 AM|PeteSmith|LINK
Oh boy, I really can't believe that this feature still hasn't made it into IIS....
@qbernard
the "solution" with the empty HostHeader is no more than a crude workaround, that wastes IP addresses and creates additional adminitrative overhead on the DNS level. (as well as networking, firewall, etc. - if you really take into account what it means to provide additional IP addresses for servers)
7019 Posts
MVP
Re: Wildcard host header support
Jan 07, 2013 08:57 PM|qbernard|LINK
@@ Yes it is, i'm just addressing OP for his needs in his setup.
This feature is NOT in IIS yet, this feature should be available since IIS 6 :)
Bernard Cheah
4 Posts
Re: Wildcard host header support
Oct 03, 2014 07:16 AM|PeteSmith|LINK
holy camoly, this feature finally made it's debut in IIS with Windows 10
Ok, it only supports wilcards in the host part of an URI and not for domain or tld, but at least it's a beginning.
1 Post
Re: Wildcard host header support
Mar 05, 2015 08:14 PM|adebear|LINK
I can't understand why it's been so much trouble! It's just a simple string match, why not just enable regex on the check!!!
I agree this should have been in from the beginning, a Microsoft tech saying use Apache isn't an acceptable answer either!
1 Post
Re: Wildcard host header support
Jul 09, 2015 02:16 PM|SQLBlimp|LINK
Wildcard subdomains are needed. People misspell www all the time (seriously) and these people will get 403 errors and think that the site is down. Others fail to put www into the address at all. It would not be too hard for IIS to order by TLD, and then each domain and then to search subdomains, and if there is no exact match, then test wildcards.
Something else that would be helpful is a "This site answers all host headers not otherwise specified" type of request. This would be a default web site. I consider this a vital thing that is missing, and the end result is a high number of 403 responses to slightly misspelled URLs.
5494 Posts
MVP
Moderator
Re: Wildcard host header support
Jul 14, 2015 10:33 AM|Rovastar|LINK
There are workarounds.
I use separate IPs for wildcard sites and bind to the IP not host headers.
https://www.leansentry.com/
61 Posts
Re: Wildcard host header support
Jul 14, 2015 12:36 PM|tweenet|LINK
When I look at this on Windows Server 2016 Technical Preview 2, I can finally add a wildcard hostname:
and it seems to work.
And I thought there was nothing new in IIS 10 except for HTTP/2 support.
5494 Posts
MVP
Moderator
Re: Wildcard host header support
Jul 14, 2015 01:01 PM|Rovastar|LINK
Microsofts iis team (if any are left that are not moved to azure) are doing a poor job giving any information of the features.
https://www.leansentry.com/
4 Posts
Re: Wildcard host header support
Jul 14, 2015 01:06 PM|CoreM|LINK
This is great news! Downloading the technical preview now. This will make a huge difference for simplifying sites with multiple subdomains and SEO redirects.
61 Posts
Re: Wildcard host header support
Jul 14, 2015 02:43 PM|tweenet|LINK
@Rovastar - I just started a blog post about new features in IIS 10, there are not many:
http://peter.hahndorf.eu/blog/iis10.html
5494 Posts
MVP
Moderator
Re: Wildcard host header support
Jul 14, 2015 03:02 PM|Rovastar|LINK
Nice one. With little official news this is a useful resource.
https://www.leansentry.com/