Addon domains are one of the best features that is provided to you by your web hosting provider. Your single web hosting account is capable of hosting multiple domains for you.

How to setup addon domains?
Well the main ingredient behind this feature is they don’t give you a different account what they do is provide you with a sub domain on your main domain and the addon domain points to that sub domain.

Like for example: You have a hosting account at www.yourhosting.com now if you add an add on domain named www.yoursecondsite.com what the control panel (mainly cPanel) does is automatically make a sub domain named yoursecondsite.yourhosting.com

Now, this addon domain www.yoursecondsite.com points to yoursecondsite.yourhosting.com! Well you could also visit this site if following manner:
www.yoursecondsite.com (The domain).
yoursecondsite.yourhosting.com (The sub domain created).
www.yourhosting.com/yoursecondsite/(The folder counterpart).

You could see an article and a video which describes how to create and setup an addon domain.

Now as you could see that there we have three sites (well they are six in total the rest of the three being there http:// counterpart) having exactly the same content well all those sites are the same but does Google knows it?. No, what should we do?

A simple thing you could do is just don’t link any of you sub domain or folder so that they don’t get indexed! This would solve the problem.

A bit more tech stuff let’s do 301 redirect (permanent) to the www.yoursecondsite.com!

Put the code below in the .htaccess file on the directory /yoursecondsite/ located at www.yourhosting.com so the complete address becomes www.yourhosting.com/yoursecondsite/

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

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

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

And put this code in your .htaccess on your root of the hosting account i.e www.yourhosting.com :

Options +FollowSymlinks
RewriteEngine OnRedirect /yoursecondsite http://www.yoursecondsite.com

That would make all the issues of addon domains duplicate content issue rectified!

Read also: How to Park a Domain on an Addon Domain.