The Hello Bar is a simple notification bar that engages users and communicates a call to action.


SEO Problems When Using BlueHost for Multiple Domains

www_imageNo matter if you use BlueHost (which I highly recommend) or another hosting provider, SEO (Search Engine Optimization) should be important to everyone with a website because applying certain SEO tactics and strategies will help you to rank better with the Search Engines, which in turn will make it easier for people to find your website as opposed to someone else’s when they search for keywords related to your site’s content. SEO issues and problems can arise, though, when working with one hosting account and multiple domains. You may need to edit the .htaccess file to overcome these issues, which I’ll explain in this post.

I’ve been learning a lot about SEO in the past little while, and dealing with SEO issues is something every web designer should be aware of. It’s no secret that I use BlueHost for my domains and WordPress websites, and have been doing so for the past two years or so. I highly recommend BlueHost as a hosting provider, especially since you only need one hosting account to host many domains, which is exactly what I do.

Having gotten into the website building and creation business, over the years I’ve learned a lot about hosting, domains, subdomains, and more. I’ve also learned a bit about working with .htaccess files, which we’ll look at in a few minutes.

If you’re a beginner, here’s a simple way of looking at these four things:


  • Hosting is basically a service that holds the files needed to serve up your website, so when someone goes to YourDomain.com, they’ll actually see your website.
  • Your domain is you internet address. Just like your house as a street address (such a 222 Street Ave.), a website needs an address as well, and that’s what the www.yourdomain.com is. The .com is almost similar or equivalent to the country you live in – .com stands for commercial and is the most common and sough-after type of domain. It is considered a “top-level domain”. .ca, for example, stands for Canada, .au for Australia, .uk for the United Kingdom and so on.
  • A subdomain is when you have “something.yourdomain.com” instead of www.yourdomain.com, or just yourdomain.com. It is a domain that piggy-backs on your main domain name, and there are many different uses for subdomain, but basically you can create a brand new site with a subdomain without having to register and pay for a brand new domain.
  • A file named “.htaccess” is basically a configuration file used by Apache Web Servers containing certain commands to enable or disable different features and functionality.



Keeping these points in mind, I mentioned that with BlueHost, you don’t need more than one hosting account to host many different domains. BlueHost accomplishes this by assigning a Primary Domain (usually the first domain you register) to your account, and all your additional domains become secondary domains that are initially set up as subdomains to your main domain name.

To give you an example:

Your Primary Domain = primary.com
Your Second Domain that you register = secondary.com

BlueHost adds this domain to your account initially as:

secondary.primary.com

Then it tweaks the system so that you have secondary.com and it points to the right “folder” containing the appropriate files for the new site you would’ve built for this site, but in the background, without anyone really noticing, you still have secondary.primary.com running and available.

Now, yes, I did mention that no one usually notices this – no human, that is. Search Engine Robots are a whole different story, though! They crawl all over the web through any existing domain in order to index every site they find on the internet. This puts you in a situation where you have your website at two different addresses: secondary.com, and secondary.primary.com, which means you have duplicate content to deal with, and this is a big SEO “no-no”.

Since BlueHost uses an Apache Web Server to serve up websites, the solution is to use a .htaccess file within the folder containing your secondary domain’s files. In this case, we want to tell the Apache server to redirect the secondary.primary.com domain to simply www.secondary.com (or secondary.com).

After some research, I found an easy way to do this that I’ve implemented successfully with my own domains.

You would need to download the .htaccess file in your subdomain’s folder via FTP (I use FileZilla – it’s a free FTP client) to your local computer so that you can edit it, then just use a basic text editor such as Notepad in Windows. If you’re running a WordPress site, there will likely be a file named “.htaccess” already there, but if not, you may need to create a file from scratch and name it “.htaccess”. Use Notepad to do this, but be sure to change the name of the file after so that it doesn’t have “.txt” at the end.

Add the following lines, replacing “YourSecondaryDomain” with your actual secondary domain name:


RewriteEngine On
## SEO REWRITE

RewriteCond %{HTTP_HOST} !^www.YourSecondaryDomain.com
RewriteRule (.*) http://www.YourSecondaryDomain.com/$1 [R=301,L]


Then save the file, upload it back to the folder from which you downloaded it (replacing the old file), and then ta-da! You’re ready to go!

Now, if you were to try to go to the secondary.primary.com address, it’ll redirect you to the secondary.com domain as an SEO-friendly redirect, which also means the search engine robots won’t index both sites, which in turn means you don’t have duplicate content!

I’m sure other hosting providers use this method of having multiple domains within a single hosting account, so you can probably use these instructions for many other hosts, though I’ve only had experience with BlueHost, which is my preferred shared-hosting provider.

Did that make sense to you? If you’re unsure about anything, please feel free to post a question in the comments section below and I will do my best to answer and clarify for you!


Related posts:

  1. Discover How to Improve Your Page Rank and Site Traffic
  2. Build a Better Online Business with WordPress
  3. New Beginnings with WordPress
  4. Differences Between WordPress.com and WordPress.org
  5. WordPress Security Tips: Avoid The Hackers Series (Part 1)

About

Ursula (nicknamed WP Gal) lives in Arnprior, Ontario, in the Ottawa Valley which is the National Capital Region of Canada. When she isn't obsessing over web design with WordPress, social media, or helping to train clients on how to use these solutions, you will find her playing the MMORPG game City of Heroes with her husband. Ursula started her web design and internet marketing journey from a need to design a website for her own musical compositions, found at Tathiana.com. Her web design, social media, and training services are offered through UC Web Creations. You can also find her at Facebook.com/UCWebCreations and on Twitter @UCTweets.

Comment with Facebook

17 Comments

  1. great tips, thank you

    • No problem, Sara – glad you found them useful!

      • When i opened the .htaccess file it looked like this ..where to change ?
        Can you help me please

        # Use PHP5 Single php.ini as default
        AddHandler application/x-httpd-php5s .php

        # BEGIN WordPress

        RewriteEngine On
        RewriteBase /
        RewriteRule ^index.php$ – [L]
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule . /index.php [L]

        # END WordPress

        • thank you….Sara
          Uttam

          • I have one more query…today only i installed wp on my second domain . my question do we have two .htaccess file or only one for the two domain …

            thanks
            uttam

          • You would have a .htaccess file for each domain. Notice that your second domain has its own folder, so if you’re looking at your files via FTP, it’s likely in /public_html/subdomainaddress (where “subdomainaddress” is your second domain). This is your secondary domain’s folder, and other domains you create would also need their own .htaccess file.

            Each .htaccess file located at the root folder of your domains is specific to that domain. You don’t need the above code for your primary domain, but you will need it for all secondary domains, and yes, each one will have its own .htaccess file.

            Hope that answers your question! :)

  2. Yes. This takes care of that annoying secondary.primary.com bluhost sub-domain issue. However, there is another problem with bluehost. They only allow you to place the document roots for your secondary domains inside the document root of your primary domain. Therefore, your content of your secondary.com is also served from http://www.primary.com/secondary-com/ (secondary-com is whatever you choose as the document root directory name when you add your secondary domain). This is not only an SEO issue bot a potential security risk for your site. I tried working around it by creating mod_rewrite rules in .htaccess for the primary domain, mainly to redirect requests for http://www.primary.com/secondary-com/ to http://www.secondary.com. Unfortunately they already placed some settings in the httpd.com that make those rules being ignored. I made numerous request to bluehost to do something about it, but their response was “Sorry, this is how our servers are configured!” They even suggested Taking my sites somewhere else “if I don’t like it”.

    • Hi Michael!

      That is a very valid point, and thank you for bringing it up! I had no idea that was also running in the background… I have a lot of subdomains on my account for various purposes, and I just tested a few of them out based on what you said (www.primary.com/secondary – you don’t even need the com), and it led me to each subdomain’s respective site!

      I agree that it is a potential security risk, but unless someone knows what domains you own, they wouldn’t really know to go to each respective folder.

      I’m assuming many of the shared hosts work the same way and that the search engines take this into account… at least I hope they do!

      Thanks for the comment!

  3. No problem, Sara – glad you found them useful!

  4. That is also how it works on JustHost. Really makes web hosting easy. Thanks.
    ReputationManagementConsultants.com

  5. You’re absolutely right – other shared hosting providers work the same way, so the above instructions could also be used with them. Definitely does make web hosting easy and affordable! Glad to help! :)

  6. Just add the lines I mentioned at the end… so:


    # Use PHP5 Single php.ini as default
    AddHandler application/x-httpd-php5s .php

    # BEGIN WordPress

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

    # END WordPress

    RewriteEngine On
    ## SEO REWRITE

    RewriteCond %{HTTP_HOST} !^www.YourSecondaryDomain.com
    RewriteRule (.*) http://www.YourSecondaryDomain.com/$1 [R=301,L]

    Make sure you then upload it and replace the old file (and also change “YourSecondaryDomain.com” to your actual secondary domain). That should work for you! :)

  7. Thank you very much.

    Uttam

  8. No problem – glad I was able to help! :)

  9. correct – one of our clients uses justhost and said he’s sticking to justhost coz it’s easy

  10. Do you know?

    Do you know why this isn’t standard on BlueHost?

    I can’t say I like the fact that I automatically get a seconddomain.domain.com…

    And I toally agree on the duplicate issues.

  11. That’s a good question. I think it has to do with how BlueHost’s hosting works – additional domains on a hosting account are considered “add-on” domains, and you have one domain set as your primary domain. For example, if you want to use secure SSL hosting, this can only be done on the primary domain, not the secondary “add-on” domains. You would need a separate hosting account with the desired domain set as the primary to accomplish this, if the SSL was needed on one of the secondary domains. Basically, it’s a pain to be faced (no pain, no gain) if you want to keep your hosting costs down and host multiple domains on one account.

Leave a Reply

CommentLuv badge