Using URLRewrite to rename a website
April 29, 2008 – 2:23 pmIn the process of renaming our website from MyFriendSuggests.com to theSUGGESTR.com I found that most articles on this refer to using mod_rewrite to accomplish the redirect. However for most us Java guys this may not be the way to go. I used URLRewrite to accomplish this name change and have 301(Permanent redirects) from my old URL to my new one. 301’s work best with search engines and will help preserve your page rank.
Here is the URL Rewrite configuration I used:
<rule>
<name>Domain Change</name>
<condition name=”host” operator=”notequal”>www.newdomain.com</condition>
<condition name=”host” operator=”notequal”>localhost</condition>
<from>^/(.*)</from>
<to type=”permanent-redirect”>http://www.newdomain.com/$1</to>
</rule>
<rule>
<name>Domain Change</name>
<condition name=”host” operator=”notequal”>www.newdomain.com</condition>
<condition name=”host” operator=”notequal”>localhost</condition>
<from>^/$</from>
<to type=”permanent-redirect”>http://www.newdomain.com/</to>
</rule>
Note for this to work your old domain must still be pointed at your server (via DNS entry).
301 Redirection Rename Website URLRewrite