Primary domain redirect to secondary addon domain

Using a single web hosting account to host multiple sites

Primary domain redirect to secondary addon domain

Postby vegimatt » Wed Dec 19, 2007 5:07 am

Hi, my current setup with my host is such that my primary hosted domain one.com holds the add-on domains two.com and three.com as follows:

one.com/public_html/ (root)
one.com/public_html/two/
one.com/public_html/three

If I do a standard redirect 301 of one.com --> two.com, then all other addon domains found below the primary domain also point to two.com (ie. three.com --> two.com)

What I want is:

one.com --> two.com
one.co.uk --> two.com
two.com (no redirect)
two.co.uk --> two.com
three.com (no redirect)

Can anyone help? And where would .htaccess need placing, under the primary root? I ask, because I have non-www redirecting to www in .htaccess files within one.com/public_html/two/ and one.com/public_html/three

Thanks alot, Matt
vegimatt
 
Posts: 1
Joined: Wed Dec 19, 2007 4:55 am

Postby richardk » Wed Dec 19, 2007 1:07 pm

Try the following in a .htaccess file in one.com/public_html/
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteCond %{HTTP_HOST} ^(www\.)?one\.com$ [NC]
RewriteRule ^(.*)$ http://www.two.com/$1 [R=301,L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am


Return to Domain Handling

Who is online

Users browsing this forum: No registered users and 18 guests

cron