I'd like to use the URL Rewrite module in IIS 7.5 to redirect all requests not from a particular sub-domain (x.domain.com) to a specific folder/file.
For example, these should work as-is:
While anything like these:
y.domain.com y.domain.com/asdf domain.com domain.com/asdf
Should redirect to a specific page like this (exact URL, not dependent upon sub-domain used):
Unfortunately I can't get the rule configured correctly, as while it matches correctly, most of the time, when it does it just results in a redirect loop. (I know I should put the faulty rules I have setup now, but they're not even consistently resulting in a redirect loop.)
Setting up another Web site in IIS that matches www.domain.com and domain.com is the easy solution, but I'd much rather have one Web site that handles it all and redirects.
What's the correct setup to get this behavior (either using the UI or adding it to the Web.config directly).