Location : Web Hosting - Web Hosting Knowledge Base - Domain Name Tutorial

Addon Domain Tutorial

Addon domain is virtual domain setup that points to a sub folder within the master domain's hosting account, for example :-

You have a hosting account with master domain masterdomain.com, the root path for this hosting account is public_html

You have setup a addon domain addondomain.com, cpanel will setup a virtual domain record for this domain and set the root path to a subfolder within the master domain's root path, that is public_html/addondomain

This setup allows serving of different sets of content, content for master domain is placed in public_html folder, and content for addondomain.com is placed in public_html/addondomain.

Search engines and addon domains

Unlike parked domains where there are duplicate content issues, addon domains do not have such problem because each domain is able to serve unique content, one consideration is that you must have a good and clear navigation path setup in every web page, otherwise you may accidentally directed search engine crawlers to content area for addon domain, this can create potential duplicate content issue.

In a typical cpanel addon domain setup, there can be four ways to access the content in an addon domain :-

www.masterdomain.com/addondomain/ (because the addondomain folder is a sub folder within the master domain root path)
www.addondomain.com (because addondomain is setup as a virtual domain pointing to the /home/masterdomain/public_html/addondomain/ path)
addondomain.masterdomain.com (every addon domain is 'parked' on to a subdomain of master domain, this is a typical cpanel setup)

If path is not setup carefully in your web pages, there is a potential for search engine crawlers to 'discover' the path to content for addon domain while crawling on master domain, you should not worry too much if path in your web pages are setup properly. However, if you are keen on setting a block, you can use rewrite rules in .htaccess to achieve that.

Place the following rewrite rule in the .htaccess file in the addondomain folder, which is the root path to the addondomain.com

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

RewriteCond %{HTTP_HOST} ^www.addondomain.masterdomain\.com
RewriteRule ^(.*)$ http://www.addondomain.com/$1 [R=permanent,L]

RewriteCond %{HTTP_HOST} ^addondomain.masterdomain\.com
RewriteRule ^(.*)$ http://www.addondomain.com/$1 [R=permanent,L]

This will send a 301 permanent redirect to www.addondomain.com if there are requests of www.addondomain.masterdomain.com or addondomain.masterdomain.com.

In the master domain root path public_html, place the following rewrite rule in the .htaccess file :-

Options +FollowSymlinks
RewriteEngine On
Redirect /addondomain http://www.addondomain.com

This will send request for www.masterdomain.com/addondomain/ to www.addondomain.com, with these rewrite rules set, potential content duplicate issue can be eliminated.