PPC Ian

PPC Ian

Dividend Investing For Everyone

  • Home
  • About PPC Ian
  • My Dividend Stock Portfolio
  • Sin Stock Investing Guide
  • Stock Analysis Worksheet
  • Yield On Cost Worksheet
You are here: Home / Archives for htaccess

BlueHost, Add-On Domains, and .htaccess

By PPC Ian Leave a Comment Jan 6 50

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!

BlueHost Web Hosting

Why Sign Up For BlueHost?

Programming Matrix

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

About PPC Ian

Ian Lopuch (PPC Ian)Hi, I'm Ian Lopuch, also known as PPC Ian. I'm a Silicon Valley business executive with an incredible passion for dividend stocks (and investments that provide true passive income for the long-term). In fact, I have built a portfolio of 40 stocks that will one day pay for all of my living expenses. I enjoy blogging here about my passion for cash flow investing, while also sharing some other business and digital marketing insights from time-to-time.

Read More About PPC Ian

My Valued Sponsors

Advertise Here     Advertise Here

Let’s Talk Stocks

Watch My YouTube Videos See My Photos On Instagram Tweet Me on Twitter Like Me on Facebook Network With Me on LinkedIn

PPC Ian Tag Cloud

3q digital acquisio ad copy adlift admedia adwords affiliate marketing bid management bing blog anniversary blog commenting charity digital marketing dividend dividends domaining ebay partner network facebook ads facebook advertising goals google google adwords ian lopuch kenshoo lending club marin software mentor box mentorbox ppc associates ppc automation ppc career ppc jobs public speaking search alliance sem agency sem automation sem career sem software seo smx smx west stanford gsb weekend musings yahoo youtube

Posts By Category

PPC Ian Dividends Yield On Cost

My Favorite Dividend Stocks For 2018 and Beyond

Check This Out These Are Dividend Checks

I Invest For Dividends and Financial Freedom

Ian Lopuch Carmel CA

Angel Investing: My Experience With SAFE Agreements

The Five Minute Journal

The Five Minute Journal: My Review and Experience

Mentor Box

My Mentorbox Review

PPC Ian at Stanford Graduate School of Business

PPC Ian Presents at Stanford GSB Again

Stanford GSB Presentation

Video: Stanford Graduate School of Business

Net

Buying Domains on Sedo

BlueHost Web Hosting

BlueHost, Add-On Domains, and .htaccess

PPC Ian
Follow on
Twitter
Connect on
Facebook
  • Home
  • About PPC Ian
  • Consulting
  • Terms and Conditions
  • Privacy Policy
  • Affiliate Disclosure
  • Disclaimer
  • Contact Me
Copyright © 2009 through 2023 PPCIan.com (An IJL Productions LLC Site). All Rights Reserved.