Subdomain Addon Domain Cpanel Problem

Subdomain Addon Domain Cpanel ProblemFor many reasons, duplicate content is bad for SEO. Today I found many duplicate from my hosting, and I need to write about subdomain addon domain cpanel problem. The problem is when I look in google index, there are many duplicate between www.addon-domain.com with addon-domain.maindomain.com, probably this is because one or few lines of bad php codes on addon-domain.com site.

Subdomain Addon Domain Cpanel Problem

Well, this simply htaccess codes will help you to prevent the subdomain cpanel (addon-domain.maindomain.com) to access the www.addon-domain.com directly, so you can improve website.

RewriteCond %{HTTP_HOST} main-domain\.com$
RewriteRule ^(.*)$ "http\:\/\/www.addon-domain\.com\/" [R=301,L]

Instruction: Put the code on .htaccess file in the root of addon-domain.com
if you are using wordpress, you can easily embed this code at the original wordpress .htaccess, so find the original wordpress htaccess, it should be like this:


RewriteEngine On

RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

Then what you must do is just change all the code like this:


RewriteEngine On

RewriteCond %{HTTP_HOST} main-domain\.com$
RewriteRule ^(.*)$ "http\:\/\/www.addon-domain\.com\/" [R=301,L]

RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

It will fix the SEO duplicate problems. Cheers!

Topics: access, addon, code, cpanel, domain, duplicate, folder, htaccess, index, main, prevent, problem, redirect, rewrite, SEO, subdomain, wordpress


Leave a Reply

© 2012 e-WWW. All rights reserved.
Proudly designed by Andhie.