I am using Server 2008 R2 to host some website. Everything is good but I have multiple domains connecting to one site. Now Google is indexing my site using a domain I do not want it to use. So lets say I have the following:
I want Google to use www.newsite.com
and not the others. However Google is indexing with www.myoldsite.com
now. I can easily create new sites for each of the two sites that need to be redirected then create some 301 redirects. However, to do this for each page would be a pain. The only difference would be the domain name. So for example if somebody went to www.myoldsite.com\contactus.php
I want to do a 301 redirect to www.newsite.com\contactus.php
I just want the domain name section changed. It would also be good to do this with or without the www. in front of the domain name. Can I do this with URL Rewrite? If so how to a create these rules?