301 redirects from multiple domains and pages

Topics: Developer Forum
Dec 9, 2009 at 5:35 PM


I have taken over 6 domains from a client and we are creating 1 new website. To preserve search rankings we want to 301 redirect certain urls for the various existing sites to the new site. All domains will have their A records updated to the new host IP also.


http://www.olddomain1/page.asp to http://www.newdomain/page.asp
http://www.olddomain2/page.htm to http://www.newdomain/page.asp

Is this possible with your component and are there any example redirect files I could take a look at for correct syntax please.



Dec 10, 2009 at 7:03 PM
Edited Dec 10, 2009 at 10:38 PM

Yes, it's possible.

There are example ini files in the documentation.

In particular, there are examples for rewriting or redirecting by hostname.  I think that's what you want.


# Iirf.ini
# ini file for redirecting requests for the old domain name to the new one

IterationLimit 10
MaxMatchCount 10
RewriteEngine ON
StatusUrl /iirfStatus
RewriteLog c:\logs\iirf
RewriteLogLevel 1

# Add www as a prefix: 
# With a request like http://olddomain.com/Alpha.htm or http://olddomain.com/Alpha.asp (or 
# if the olddomain is prefixed with www) , redirect (HTTP 301)
# the request to http://www.domain.com/Alpha.asp

RewriteCond  %{HTTP_HOST}            ^(www\.)?olddomain\.com$
RedirectRule ^/(.+)\.(htm|asp)$       http:/www.newdomain.com/$1.asp         [R=301]

Dec 10, 2009 at 9:34 PM
Edited Dec 10, 2009 at 9:34 PM

Great thanks. I did read the examples but must have missed that one. Thanks again for the pointer.