4

I have a shared hosting plan at one of the biggest hosting company. I host there a 3 sites. Today I just discovered that every site is available under a subdomain of my main domain (that was required to add at the sign up).

So samplewebsite.com is available in two ways:

1. samplewebsite.com
2. samplewebsite.maindomainname.com

For me it's simple duplication and I think it is harmful for my sites. The support told me that it's a default behavior for shared hosting with Cpanel and the only way to avoid this is upgrading to a VPS. I tried to delete the subdomains manually, but couldn't do it without deleting the added domain so it's not possible to delete them only if I remove my sites from the hosting plan.

So what should I do now? Do you think Google wont index the subdomains until I don't link them, therefore it's not a problem? Or should I have find another hosting?

I think thousands of websites are duplicated this way just at this company and since it's a default behavior I'm not sure how it affects seo. How would you deal with this?

3

I assume you are using cPanel's Addon domains? These indeed must point to a subdomain.

it's a default behavior for shared hosting with Cpanel

Yes, it's default behaviour.

Do you think Google wont index the subdomains until I don't link them, therefore it's not a problem?

If you never link to the subdomain then it's unlikely that Google will index it - but it is possible. (But even if Google did index it, whether it would rank higher than the Addon domain is another matter.)

the only way to avoid this is upgrading to a VPS

No, it's not the only way. In fact, it's relatively trivial to 301 redirect the subdomain to the Addon domain using .htaccess on Apache (per-directory Apache config file). This will resolve any possibility of the subdomain being indexed. However, (shared) hosting support rarely deal with .htaccess issues/solutions.

In the .htaccess file in the root of the Addon domain (often a subdirectory of the main domain's document root, when the subdomain is configured as a subdirectory - but this isn't necessarily the case), try the following:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^(.+)\.example\.com [NC]
RewriteRule (.*) http://www.%1.com/$1 [R=301,L]

Where example.com is your main domain. Include/omit the www subdomain in the substitution as required.

  • 1
    Yes, I'm using cPanel's Addon domains. Thanks for the detailed explanation! – rihe Dec 5 '16 at 21:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.