davioli
Regular Member
- Oct 10, 2008
- 234
- 68
Hi... I need some help doing a 301 redirect for my addon domain..to prevent a duplicate content penalty.
I got some code to put in htaccess by googling about the addon domain redirect.
here is what I have done...
Here?s the code of the main domain?s .htaccess file:
Redirect 301 /addondomain http://www.addondomain.com
RewriteEngine on
RewriteCond %{HTTP_HOST} ^addondomain.maindomain.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.addondomain.maindomain.com$
RewriteCond %{HTTP_HOST} ^maindomain.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.maindomain.com$
RewriteRule ^sitelinkedin/?$ ?http://www.addondomain.com/? [R=301,L]
And here?s the code for the Addon domain?s .htaccess file:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^addondomain.com$
RewriteRule ^/?(.*)$ ?http://www.addondomain.com/$1″ [R=301,L]
RewriteCond %{HTTP_HOST} ^addondomain.maindomain.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.addondomain.maindomain.com$
RewriteRule ^/?$ ?http://www.addondomain.com/? [R=301,L]
When checking the validity of the 301 redirect...the "maindomain.com/addondomain" is showing a proper 301 redirect...
all the others show a direct link..(no 301 redirect..)
any idea what im doing wrong above?
This would help alot of people... since many use multiple domains on single hosting accounts.
I got some code to put in htaccess by googling about the addon domain redirect.
here is what I have done...
Here?s the code of the main domain?s .htaccess file:
Redirect 301 /addondomain http://www.addondomain.com
RewriteEngine on
RewriteCond %{HTTP_HOST} ^addondomain.maindomain.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.addondomain.maindomain.com$
RewriteCond %{HTTP_HOST} ^maindomain.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.maindomain.com$
RewriteRule ^sitelinkedin/?$ ?http://www.addondomain.com/? [R=301,L]
And here?s the code for the Addon domain?s .htaccess file:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^addondomain.com$
RewriteRule ^/?(.*)$ ?http://www.addondomain.com/$1″ [R=301,L]
RewriteCond %{HTTP_HOST} ^addondomain.maindomain.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.addondomain.maindomain.com$
RewriteRule ^/?$ ?http://www.addondomain.com/? [R=301,L]
When checking the validity of the 301 redirect...the "maindomain.com/addondomain" is showing a proper 301 redirect...
all the others show a direct link..(no 301 redirect..)
any idea what im doing wrong above?
This would help alot of people... since many use multiple domains on single hosting accounts.