2

I have a site hosted on x10hosting. This site is assigned to a free subdomain. example.x10host.com.

I have now purchased my own domain: example.com

Unfortunately, x10hosting does not seem to allow me to change the main domain from the free .x10host.com to my new .com domain. Instead, I can either setup a parked domain - which redirects all traffic from example.com to example.x10host.com.

OR

It allows an add on domain. This is better in that if you go to example.com ... That is what is displayed as the web address in the browser. If I use the parked domain option, it shows that it has redirected to my example.x10host.com.

Soooo.... My question is: What would be the best way to manage these 2 domains in relation to google and other search engines. I'm guessing Google will find 2 domains with duplicate content. How can I ensure that only example.com is indexed and not example.x10host.com.

I have google webmaster console setup for both domains. As they share the same content - they also share the robots.txt file - so not sure how I can permanently stop Google indexing the x10host subdomain.

4
  • What kind of webserver is it? Do you have access to (something like) .htaccess? What server-side scripting language are you using? PHP?
    – MrWhite
    Sep 22, 2015 at 8:53
  • X10hosting uses cPanel. So I can access .htaccess from its file manager. Sep 22, 2015 at 9:18
  • I did think of another idea... The add on domain does not have to point to the root html folder. It can point to a custom folder. So I may be able to move my website into a custom folder... Point mywebsite.com domain to that folder, and then remove the html documents on the root (that x10host.com subdomain uses. If this works - will it solve the duplicate content issue. Or is there a better way. I'm hopeful mywebsite.com will see its 'folder' as its 'root' so it can have its own robots.txt. Sep 22, 2015 at 9:29
  • I could then have a robots.txt in the root folder that disallows all - making the subdomain redundant - while my website.com points to a folder that has its own robots.txt allowing it to be indexed... Sep 22, 2015 at 9:31

1 Answer 1

2

I can access .htaccess from its file manager.

In which case the easiest/safest way is probably just to set up a permanent redirect from the subdomain to the main domain (assuming both the subdomain and main domain are pointing to the same place):

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

Where example.com is your canonical domain name.

Another approach is to set a <link rel="canonical" element in the head section of your pages pointing to the canonical URL. This will also avoid duplicate content issues with Google, providing both domains are verified in Google's Search Console. However, users would still be able to access your site by the x10host subdomain.

I'm not aware that you can specify this preference in Google Search Console alone, since you will still need to setup (and confirm) a 301 redirect.

I can either setup a parked domain - which redirects all traffic from example.com to example.x10host.com.

"Parked domains" don't normally perform an external redirection? Although this is usually an additional option that can be set in cPanel. (Maybe x10hosting do something different in this respect?)

9
  • I will try this now. Do I add my entire subdomain address where you have x10host? Eg example.x10host.com Sep 22, 2015 at 10:31
  • No need to include the entire subdomain, the above (regular expression) will match if x10host occurs anywhere in the host. (Assuming that your actual domain doesn't contain the string "x10host"! :)
    – MrWhite
    Sep 22, 2015 at 10:35
  • 1
    Cool. The .htaccess seems to work so far. If I try and go to example.x10host.com it redirects to example.com. Since I have both domains in my Google webmaster console... I went to my x10host subdomain, selected change of address, and then selected my new domain to indicate I'm moving my site to a new domain. It passed the 301 redirect and verification and has been submitted - so hopefully all indexing from my subdomain will be transferred to my new one... Not sure how long it will take for the new domain to start showing up in Google... Sep 22, 2015 at 11:35
  • IMPORTANT: I've just corrected a (silly) mistake in the RewriteRule. It needs the trailing /$1 on the end of the substitution! Without this, all URLs would redirect to your homepage (which would still cause Google to pass the 301 redirect initially)! (Sorry about that.)
    – MrWhite
    Sep 22, 2015 at 11:41
  • Thanks! Have made the change. Was it the right thing to request the change of address/domain from subdomain to new domain on the Google webmaster console? Sep 22, 2015 at 11:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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