0

I need to add a "Site Mapping" on IIS 7.5 to accept domains that meet some wildcard, for example: I need some web site to be mapped to the subdomain:

*.aaa.bbbb.com

That means: anything.aaa.bbbb.com and so.

Saw
  • 139
  • 10
  • You need to add more detail to prevent this question being closed. Have you tried to make this work? What did you do? What was the result? Error messages? ServerFault isn't suited to "spoonfeeding" type questions of the "Tell me how to do X" variety. – ThatGraemeGuy Mar 27 '12 at 14:53
  • 1
    So... you want `a.aaa.bbb.com` to display the exact same content as `b.aaa.bbbb.com`? Or do you need to differentiate between the subdomain host headers? – Mathias R. Jessen Mar 27 '12 at 14:55
  • Yes, that is what i want, and i will differentiate between them using my server side code. – Saw Apr 02 '12 at 08:29

2 Answers2

2

Unlike Apache, IIS 7.5 does not natively support wildcard bindings like you have described when using name based hosting.

You could switch from name based hosting to IP based hosting, and dedicate 1 IP to this website. This isn't always a great utilization of IPs.

That being said, you could achieve the desired result using URL Rewrite using a rule that looks for *.aaa.bbbb.com and rewrites it as a request for aaa.bbbb.com:

<rule name="CustomRule" enabled="true" patternSyntax="Wildcard" stopProcessing="true">
  <match url="*.aaa.bbbb.com" />
  <action type="Rewrite" url="http://aaa.bbbb.com/{R:0}" />
</rule>
Chris Anton
  • 810
  • 1
  • 6
  • 14
1

Setup a wildcard DNS entry that resolves any host to a particular IP address (dedicated) and set that IP on the bindings. Hopefully someday, IIS will have this feature.