As mentioned in my 2010 goals, I’m extremely excited about the domaining industry. My 2010 goals have me attending at least one major domaining conference in addition to developing at least six websites. (Honestly, I’m sandbagging a bit and hope to develop quite a few more websites than six.) Domaining and web publishing in my opinion are excellent ways to master SEO while building up some passive income. (You may wish to read my article about moonlighting your way to success in your PPC career.)
In today’s article, I’d like to feature a low level discussion on hosting multiple domains within a single web hosting account, a cost effective method for anyone to develop multiple websites this year. Specifically, I will be sharing my BlueHost story. I hope to save you the many hours it took me to figure out configuration of the .htaccess file to optimize SEO for add-on domains with BlueHost. Sound confusing? Don’t worry! I will explain in full detail below!
Why Sign Up For BlueHost?
BlueHost is a very trusted web host, one that I’ve heard great things about over the years. They are extremely reliable and moreover offer the ability to host multiple domains within a single account (with unlimited bandwidth) for only $6.95 per month (or possibly less if you have a coupon). This is a dream come true for all you domainers out there! So, I signed up and thought it would be super easy to instantly host multiple sites within one simple account.
As a side note, I’m a big proponent of online marketing diversification. As you publish more and more websites, it’s extremely important to go with multiple hosts and registrars. Looking to diversify, it made perfect sense for me to give BlueHost a try. In your quest to diversify, I recommend GoDaddy, BlueHost, and Host Gator on the hosting side. On the registrar side, I recommend GoDaddy and Moniker. As your side business expands, diversification mitigates risk of downtime.
BlueHost and Add-On Domain Confusion
Signing up for BlueHost with your initial domain is super easy. You point your nameservers to BlueHost, open an account, link in the domain, upload your website, and you’re done. When you want to start hosting an additional add-on domain, however, things can get a little tricky (but I will fully explain all the steps to make the process a breeze for you).
Specifically, BlueHost stores files for your add-on domain as a sub-folder of your main domain. For example, let’s say I have two sites, example1 (main site) and example2 (add-on site). All files for example2 will be in a subfolder under example1 (you can name the subfolder whatever you want but I recommend just keeping it simple and sticking to the site’s name).
http://www.example1.com/example2/
To make things even more confusing, BlueHost also makes example2 a subdomain of example1 (you can name the subdomain whatever you want but I recommend just keeping it simple and sticking to the site’s name).
http://example2.example1.com/
Of course, example2 will also function as a URL on its own.
http://www.example2.com/
SEO and Duplicate Content Do Not Mix Well
As you may already know, Google and other search engines hate duplicate content. The fact that your example2 website now shows up three times at three different URLs opens you up to all sorts of duplicate content issues. If Google indexes all three URLs, you will immediately have SEO problems.
However, this can all be prevented with the use of 301 redirects in your .htaccess file. 301 Redirects are the SEO friendly way to tell Google and other search engines that the files for your website have permanently moved to another location. Because you never intended to have a site at http://www.example1.com/example2/
or http://example2.example1.com/
you will clearly want to 301 redirect these two domains to http://www.example2.com/
. As someone who has previous experience with .htaccess, I thought the 301 redirects would be a breeze in this case but they actually gave me a run for my money.
How To Configure Your BlueHost .htaccess Files For Add-On Domains
I’d like to close this article out with the actual code you’ll want to use in your .htaccess files, both the one in your root www folder for your main domain and the one(s) in your add-on domain folder(s). I first tired to leverage cPanel’s redirect GUI to make this happen, but it didn’t fully work. The code below is a combination of my use of cPanel’s GUI and my own trial and error.
Your Main Site’s .htaccess File
(In the following code, example1 is your main site and example2 is your add-on site.)
Options +FollowSymLinks
RewriteEngine On
Redirect 301 /example2/ http://www.example2.com/
Redirect 301 /example2 http://www.example2.com/
RewriteCond %{HTTP_HOST} ^example1\.com$ [NC]
RewriteRule ^(.*)$ http://www.example1.com/$1 [R=301,L]
Your Add-On Site’s .htaccess File
(In the following code, example1 is your main site and example2 is your add-on site.)
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_HOST} ^example2.example1.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.example2.example1.com$
RewriteRule ^(.*)$ "http\:\/\/www\.example2\.com\/$1" [R=301,L]
RewriteCond %{HTTP_HOST} ^example2\.com$ [NC]
RewriteRule ^(.*)$ http://www.example2.com/$1 [R=301,L]
An Extra 301 Redirect To Help You Out
If you’re an .htaccess wizard, you may have noticed that I not only help you out here with the above discussed 301 redirects, but I also help redirect non-www versions of your site to the www version (via 301 redirects as well), another common SEO duplicate content issue for many sites. I sincerely hope this helps you out. It’s truly amazing that for only $6.95 per month you can now host multiple sites in an SEO-friendly manner with just a little up front work understanding and configuring your .htaccess file.
Disclaimer: Please use this code at your own risk. Your .htaccess file is a very powerful tool. Before making any changes, please back up your entire site. PPCIan.com is not liable for any problems that may arise from following these examples.
Image of Programming Matrix © iStockPhoto – Raycat
Jake says
Keep us posted! I can’t wait to see how you’re 6 (or more!) websites turn out.
-Jake
Ian says
Hi Jake,
Thanks so much for the comment! I will definitely keep you posted as I start making some progress.
All the best,
Ian
Josh says
Oh man! this is exactly what I needed!!!! You just solved my bluehost problem! – Josh
Ian says
Awesome, that’s great to hear! Josh, thanks for reading my blog. I’m glad I could help!
All the best,
Ian
Doyle Lewis says
The .htaccess should actually be much, much simpler than that. In your example2 folder use the following code:
RewriteEngine On
## SEO REWRITE
RewriteCond %{HTTP_HOST} !^www\.example2\.com
RewriteRule (.*) http://www.example2.com/$1 [R=301,L]
That will check the host for all requests for a file in that folder and redirect if they aren’t what you want. Then you’re not having to manage multiple code chunks in multiple files. Also allows you to control the www or no-www if you want, with one small change in the same 3 lines of code.
Friends with JV, found your site from the interview there.
Ian says
Thanks Doyle for the tip and for visiting my site! Really appreciate it. As someone relatively new to .htaccess, always looking to learn more and appreciate your insights.
All the best,
Ian
Elise says
Thanks for this! I’ve been back and forth with the Bluehost team about this problem. When I just stuck that add-on code of yours into my main .htaccess… my site FINALLY worked! What a relief!
Ian says
Elise,
Thank you for visiting my site and for the comment! You are quite welcome! I’m glad I could help.
All the best,
Ian
Paul B says
Hi Ian,
I’ve been using Bluehost for a couple of years and have several accounts and dozens of domains. I’ve never bothered with redirecting the other “copies” of the subdomains and have never noticed any negative SEO impact, I’m assuming because there is no reason why those URI’s would be crawled and indexed? Am I missing something here? I’ll certainly be going over 1 or 2 domains in great detail just to make sure, thanks for the tip.
Paul
Ian says
Paul,
Thanks so much for visiting my blog and for the comment! You bring up a VERY good point. I’m a VERY paranoid guy. When it comes to SEO, I freak out about stuff and therefore take every precaution possible to prevent issues from coming up. You are exactly right that if you never link to the URLs you don’t want indexed, they theoretically shouldn’t get indexed. However, it’s been my experience in the past that stuff always gets indexed when I don’t want it to. Google is really great at that! 🙂 For this reason, I’m all about taking the added precaution of redirecting the versions I don’t want indexed. Thanks again for sharing your experience!
All the best,
Ian
Paul B says
Ian,
I guess I work the other way around – I never try to fix anything until I know for sure that it’s broke! I can be in denial for quite some time 🙂 What I like about the latest evolution of the search engines is how easy it is to make corrections and alter what content they see and how they see it.
Cheers,
Paul
Ian says
Paul,
Makes total sense. 🙂 Always enjoy learning from other perspectives and thanks again for the comments. Looking forward to learning more about your SEO strategies and experience!
All the best,
Ian
Springboard SEO says
Hey Ian,
Interesting post – I found it by searching for ‘bluehost addon domains duplicate content’.
Have you had additional thoughts on the necessity of the 301s to avoid dupe content from the addons? I’m considering doing the 301 as well (hence my google search). Have you tried incorporating Doyle Lewis’s .haccess with success?
Slightly off topic – do you have any personal recommendations for reasonably priced hosting solutions that offer different IPs for different domains without having to pay for new accounts?
cheers,
Matt
Springboard SEO says
To follow up – I’ve implemented Doyle Lewis’s version of the .htaccess and can attest that it works properly.
Ian says
Hey Matt,
Thanks so much for the comment and for visiting my site, I truly appreciate it! I actually hadn’t had the chance to try Doyle Lewis’s code yet so it’s absolutely awesome to hear that it works for you. Thanks so much for circling back and sharing that info!
In terms of reasonably priced hosting solutions that offer different IPs for different sites within the same overall account, that’s a great question. Unfortunately, I don’t have a great answer for you. On the domain development side, my portfolio isn’t too big so I’ve been able to to solve the IP issue by having several accounts across the cheap but great hosts such as Blue Host and Host Gator. At some of these guys, I have more than one account (each on a different box). I originally pursued this strategy for stability (if one host goes down, I didn’t want it to wipe out all of my sites), but it also has the added benefit of diversifying across IPs.
Thanks once again, Matt, and I’m looking forward to checking out your site as well!
All the best,
Ian
Springboard SEO says
It’s a pleasure Ian.
I’m sitting here right now wondering about the addon domain situation with Bluehost. I set up wordpress on an addon last night, and in the footer of the WP install I see copyright springboard SEO (my primary domain). I didn’t associate anything in the addon domain with Springboard SEO.
I’m really starting to wonder if the search engines will see the sites as being unique entities. The fact that the addons are subdomains of the primary domain has me concerned.
Ian says
Hey Matt,
Thanks once again for sharing. That is really interesting. I’m definitely not a WordPress guru (PPCIan.com is my first WordPress site) so I’m unfortunately not able to help you. The sites that I’m hosting as add-on domains are typically 5-page minisites, all hard coded in HTML. For this particular use case, I have no issues with the add-on domains with proper htaccess 301 redirects. However, I can see your point with your add-ons referencing your main site. There has got to be a way around this! While I don’t have the answer, you may wish to ask some of the domainers linked too in my blogroll. I know at least a few of these guys leverage WordPress as their domaining platform and must have a workaround for this. Best of luck and thanks once again for your valuable comments!
Best,
Ian
Andrew Stolpe says
I’m having some trouble getting this to work properly. For my simple websites, it is working fine but for my PHPLinkDirectory — not so much. If you do the following search on google you’ll see my problem:
site:gundersenconstructioncorp.com
This is the 301 dupe content issue that people keep tlaking about on bluehost. Somehow that subdomain for my directory got indexed. When you go to some of the indexed URLs (http://directories-r-us.gundersenconstructioncorp.com/News/Internet_Broadcasts/) you get forwarded to directories-r-us.com/index.php — do you think that this is bad for SEO or it will work properly? I’m really think I’m getting penalized for this problem.
Thanks,
Andrew
Jim says
BlueHost is getting worse, It really sucks
Ian says
Jim,
Thanks so much for visiting PPC Ian and for the comment! I’m sorry to hear BlueHost is not working well for you. I have had good luck with them. Let me know if there’s anything I might be able to help out with!
All the best,
Ian
Ian says
Hey Andrew,
Thanks so much for visiting PPC Ian and for the question! I took a quick look at your site and am not so sure I fully understand your issue. It might make sense to discuss over email to see if I can help you resolve your issue. Then, once we figure it out, I can post the solution here! Please check out my contact me page for my email. Thanks again!
All the best,
Ian
Profit Addiction says
Ian, I’m glad you like BlueHost but when I used them for a short period, my server went down for over 24 hours without them notifying me AT ALL. The thing is, this was my TRACKING server meaning my entire business was down for 24 hours. Poor business model on my part, possibly, but extremely poor on theirs? Definitely.
I’ve since moved onto bigger and better through WiredTree and could not speak highly enough of them.
Jeremy
Sandman says
Very usefull..Really thx.
Ian says
Sandman,
Glad my tips helped. Thanks for the comment!
All the best,
Ian
Andy Eaton says
wow I have about 6 sites on bluehost, I never heard of this seo problem until now, does it really cause any problems? I’m not sure of I should change it or not. Also does hostgator do this aswell. thanks
Ian says
Hey Andy,
Thanks for the comment! While there are many successful sites that do not 301 redirect properly, this is something I’d definitely fix. It’s really simple and is huge in terms of mitigating downside risk of double indexing. I use the code from this example in both my BlueHost account and my Host Gator accounts (I use both of these hosts). It should work fine in both of them! Best of luck to you!
All the best,
Ian
Matt Ringstad says
Hi Ian,
I found your website via John Chow’s website. I am glad I did because it has lots of great posts and information on how-to get the most from PPC and more. I will definitely become a regular visitor. Now to my question about .htaccess files.
I am currently with A2_Hosting on a Web Hosting Plan with a main domain plus several sub-domains. All the domains are separate sites that I want to be seen as separate. I am having trouble implementing the above code. It keeps failing – actually, it appears to be a looping issue. I am not too familiar with coding .htaccess files and did some research before landing here on your site. I feel pretty confident from my little knowledge that your code should work on my site. I place the code inside the .htaccess files as shown above. I try to load the sub_domain and get an error “The page isn’t redirecting properly”. I wonder if it’s a hosting issue. I have been wanting to move to HostGator and maybe this is the last straw. One of my sites is called 4hrbody.com.
Any help is greatly appreciated! -Matt
Ian says
Hey Matt,
Thanks so much for the comment! It’s great to hear my blog commentating on John Chow is working. 🙂 I’m sorry to hear about your hosting issues. When I look at your http header, it does appear that you have a looping issue. When I go to your domain with the “www”, it still does a 301 redirect to the exact same URL. While I’m not sure if the code in this post is perfect, it has gotten the job done for me on both BlueHost and also HostGator (between the two I now have about 30 websites hosted in just two accounts using this htaccess code). I would recommend both of these as quality web hosts for those looking to host multiple domains from the same account with the SEO benefits of 301 redirects in place. You may want to call the support of A2_Hosting and see if they can help. Thanks again and please report back here if you find the fix!
All the best,
Ian
Matt Ringstad says
Hi Ian,
Thanks for the nice reply. I figured as much that I had a looping issue. I appreciate you taking the time to provide me some input on this issue. I haven’t heard back from A2 Hosting as of yet and so I might be switching web hosts this weekend. BTW, do I give you the referral credit or John Chow. It’s a dilemma in the making. I will report back once I have resolved the issue.
Take Care,
Matt
Ian says
Thanks Matt,
Glad I could help (at least a little). As one last suggestion, I would recommend clearing out the htaccess files from both your root domain and your add-on domain. Then, get both sites uploaded and make sure they both function. After that, then upload the new htaccess to the add-on domain folder. Last, upload the other new htaccess to the root domain. This is the order of operations I typically follow and just want to make certain you’re using the same order of operations in case it actually affects the end result.
Sometimes, even after doing this, my sites will fail the first time I ping them, but then they work every time thereafter. Whenever I change my htaccess files on either BlueHost or HostGator, I always test all sites (both primary and all add-ons) to make sure they all work because sometimes simply changing the htaccess causes them to fail the first time after the change. Although, this is not the case you have right now because it’s stuck in a loop each time I test your site.
In terms of who’s affiliate link to use, it’s really up to you. 🙂 Of course, I’d sincerely appreciate if you used mine because I can use all the revenue I can get to keep my blog running and updated as much as possible. That said, it’s really up to you. I would look at such factors as who provided you the most value and also if you can find any discounts and special deals anywhere. Of course, I’m a huge fan of John Chow as well, he has a fantastic blog and one that I frequent every single day.
Thanks once again for the comments, I very much appreciate it!
All the best,
Ian
Matt Ringstad says
Hey Ian,
I have been SUCCESSFUL with the solving the redirect issue. Both the main site & sub-sites redirect from a non-www to a www without any lingering problems. I used the original code from your post since I didn’t notice any confirmation from you to use the suggested code from Doyle Lewis. I may do more research in the near future to better understand the .htaccess scripting, but will leave it for now since it’s working.
“How did I fix the problem?” At first, I waited to get a response back from my current host provider (A2 Hosting). I received an email from them telling me to try and fix the issue within the redirect page inside cPanel. I had already done this several times and I had explained this to them in a couple of different emails. Very frustrating. I decided to pull my main domain plus two other sub domains from A2 Hosting and move them to HostGator. Since HostGator offers a 30 day guarantee, I had nothing to lose. The first thing I noticed with switching to HostGator was the HUGE speed improvement. I didn’t expect this surprise.
After I moved my domains to HostGator, I continued to be plagued with the same redirect issue. I loaded the above code to both my main and sub-domain sites. The sites were continually flipping back and forth between non-www & www. I didn’t know what to do so I contacted Host Gator tech support chat via cPanel. After two hours on chat with HostGator tech support, we were able to track down the problem. I had a WordPress blog loaded on each of my sites. When I looked at the configuration file, I noticed that both my WordPress url and Site Address url had the non-www designated selected. It was a very simple solution. The tech support center was very committed to helping me to resolve this redirect issue and I was very impressed by there level of commitment. I am very happy with my experiences with HostGator and will be moving the remainder of my sites to them.
Take Care, Matt
Ian says
Matt,
Wow! What a great story. 🙂 Thanks so much for sharing, I’m sure this will be incredibly helpful to everyone reading this post, especially those trying to host multiple WordPress blogs within the same HostGator of BlueHost account. I have not run into this issue because, believe it or not, PPC Ian is my only WordPress blog. The rest of my SEO websites are either static websites or on the Epik product portal platform. Sometimes, this makes things difficult! I have static websites hard coded in HTML that are nearly 200 pages in size (it’s a big effort to update them). But, I digress…
You are correct, I have not tried the code from Doyle Lewis yet. I’ve got something that works so I’m reluctant to mess with it too much. 🙂 I’m so happy to hear that your issue has been resolved and that HostGator technical support was so amazingly helpful. Thank you once again for the awesome comments. It’s really great to hear about your success in debugging this issue!
All the best,
Ian
Matt Ringstad says
Thank you, Ian. I really appreciate all the support that you gave me through this ordeal. I am so spent. It’s a relief to have found a solution. BTW, you must have some old sites if they are purely static websites. Looks like you have found a great portal platform — Epik. I look forward to reading more of your posts on here. Take Care, Matt
Sarah says
Hi Ian,
I’ve used your article as a handy reference in the past re: setting up addon domains at BlueHost, but recently ran into a few issues with it when using multiple WordPress installs in the same hosting account (I’ve outlined the solution on my own blog). Nevertheless, I wanted to say a quick thanks for providing this info for other BlueHost customers to use – I found there was a huge lack of practical advice/examples regarding their support for addon domains when starting out. Many thanks!
ahmadhaikal says
how long you already try bluehost?
Ian says
Sarah,
Thanks so much for visiting my blog and for the comment! 🙂 I truly appreciate it. I’m looking forward to checking out your blog and reading your article about BlueHost and WordPress. You are exactly correct and that in my case I’m only working with static sites (not WordPress sites). Thanks again!
All the best,
Ian
Ian says
Thanks for the comment, ahmadhaikal. I’m a big fan of BlueHost and have had an account with them for around two years now. I also leverage a multitude of other hosting accounts (with other hosts) since I operate around 100 active web properties (and counting). I honestly probably have too many hosting accounts at this point, but I like the diversification of it all!
Best,
Ian
Matt says
Thanks for the quick fix 🙂
Ian says
Matt,
I appreciate the comment! You are very welcome!
All the best,
Ian
Poonam says
Thanks for the code. I was having lots of trouble with a client’s add on domain on Bluehost. This solved my problem!
Mike says
I ran into this issue last night, contact BlueHost via their “live chat” feature, got some info. that didn’t work right, went on a Google search, came across your post, implemented, and … you’re awesome! Thanks so much bro!
PPC Ian says
Mike,
Thanks so much for the comment! I’m so glad I could help! Best of luck with your BlueHost account and websites!
All the best,
Ian
Nigel Stratton says
Thanks for this. Simple straight forward answer to my question about the add-on domain .htaccess file.
Kevin says
Very helpful. Thanks.
seal rubber extrusions says
very good articles and I believe it helps much for many of domain business guys.Thanks for sharing
Greg says
I am going to change my main domain folder in to a subfolder.
Initially it is uploaded in public_html.
Now I want to transfer the files in public_html in public_html/subfolder.
BlueHost gave a code before changing anything I want to ask if the code they gave will work. Will it? Thank you in advance.
RewriteEngine on
# Change your-domain.com to be your main domain.
RewriteCond %{HTTP_HOST} ^(www.)?maindomain.com$
# Change ‘subfolder’ to be the folder you will use for your main domain.
RewriteCond %{REQUEST_URI} !^/maindomainsubfolder/
# Don’t change this line.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Change ‘subfolder’ to be the folder you will use for your main domain.
RewriteRule ^(.*)$ /maindomainsubfolder/$1
# Change yourdomain.com to be your main domain again.
# Change ‘subfolder’ to be the folder you will use for your main domain
# followed by / then the main file for your site, index.php, index.html, etc. NOTE: I do NOT want to be redirected to a specific file name so modified the code here.
RewriteCond %{HTTP_HOST} ^(www.)?maindomain.com$ RewriteRule ^(/)?$ maindomainsubfolder/index.php [L]