Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My company has a promotion in a magazine that was created before we implemented our new site. Since the release of the new site we use a inbound rewrite rule to redirect anything with a www. This advertisement however is so when a user visits it it redirects back to the homepage.

I need it to redirect to instead and can't seem to find the right combination in URL Rewrites to get it to work.

Any help would be appreciated.

Default www redirect enter image description here

What I'm trying to do enter image description here

share|improve this question

It is a better approach to this issue to register an additional as an additional host header for the site.

You can do this in IIS7 by right-clicking the site and selecting Edit Bindings. There should be one default binding such as

 Type        Host Name        Port        IP Address
 http       80*

*This should be either the IP of your server or "All Unassigned".

Click Add, then enter a new binding with all of the same information, except that the Host name should read "" instead of "". When you are done your binding will look like:

 Type        Host Name        Port        IP Address
 http       80
 http   80

Please note that this will not actually redirect the request for to, but will bind any such requests to the intended location. So, both URLs will resolve to the same resource.

share|improve this answer
Thank you for the help. – Zach Shallbetter Jun 22 '11 at 17:37

smartcaveman is correct, but you don't want both and to both work (for SEO purposes).

So, make sure you trigger the Canonical domain name rule as well. Again, you'll need all the host names in the bindings as smartcaveman detailed above.

share|improve this answer
I think that was my original thought but it seems to conflict with other 301 redirects that I need to pull off. – Zach Shallbetter Jun 22 '11 at 18:22
+1, I don't know how severe the SEO implications are of both working are. @James Skemp, do you have any documentation for this? @Zach Schallbetter, This article explains how to specify a canonical domain name rule – smartcaveman Jun 23 '11 at 1:04
@smartcaveman Thanks. Google includes the ability to specify a canonical domain via their Webmaster tools, so I'd assume there's something of one. It's been a while, so I don't quite remember how Page Rank works, if you have externals links pointing to different domains on your site that might still be impacted. I think Matt Cutts' article - - is still relevant today, despite being from 2006. A search for 'canonical domains' also returns a number of relevant results. As a rule, I've just gotten into the habit of doing this. – James Skemp Jun 23 '11 at 12:11
Sorry, unless you were talking about enabling a canonical domain using URL Rewrite (I assumed not, but just in case ...). That's found under the SEO heading, as Canonical domain name, and requires you to add each Web site domain as a binding to the site (that you want to redirect). This also helps simplify (www.)domain.(com|net|org) issues. – James Skemp Jun 23 '11 at 12:15

You're close. Add both sites and to the bindings then follow these steps.

  1. Open URL rewrite
  2. Click add rule
  3. Click Blank rule
  4. Name = call it whatever you want.
  5. Requested URL: = Matches the pattern
  6. Using: = Wildcards
  7. Pattern: = *
  8. Ignore case is checked by default
  9. Add conditions
  10. Logical Grouping: Match All
  11. Input = {HTTP_HOST}
  12. Type = Does Not Match the Pattren
  13. Pattern =
  14. Leave Server variables alone
  15. Action = Redirect
  16. Action Properties ={R:1}
  17. Redirect type: Permanent (301)
  18. Click apply
share|improve this answer
Is this not the answer you were looking for? – Tatas Jun 23 '11 at 21:20
It seems as thought that's going to rewrite/redirect anything after That causes a number of problems since the site structure is completely different. – Zach Shallbetter Jul 5 '11 at 21:09
Yes with the site structure being different it's not going to work. I must have missed that. You'll want to stay with what you're doing in the example above. Have you tried changing the order of the rewrite rules? What happens when you hit the www. link? Does it just remove the www. and keep the same site structure? – Tatas Jul 6 '11 at 17:49

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.