over here on frihost I use DirectAdmin so I never used the cpanel interface before. i was helping a friend to move his site to a new hosting provider and i noticed that when you create an addon domain in the cpanel you also create a subdomain on the main domain of the hosting.
i contacted his tech support and they told me that's how cpanel works and that i could use rewrite rules to fix the problem. i found this really annoying since i figure there would be seo problems if you have 2 addresses with the same content. i read a bit on the net and i came up with this solution to remove the 2 urls created by the subdomain made by cpanel (2ndDomain.1stDomain.com and 1stDomain.com/2ndDomain.com):
RewriteCond %{HTTP_HOST} ^(www.)?2ndDomain.1stDomain.com [NC]
RewriteRule ^(.*)$ http://www.1stDomain.com/ [L,R=301]
RewriteCond %{HTTP_HOST} ^(www\.)?1stDomain\.com$
RewriteRule ^2ndDomain.com/(.*) http://www.1stDomain.com/ [R=301,L]
I'm guessing there must be other people ot there that have had this problem so let me know if this solution makes sense or what you did to fix this problem. thanks in advance!
i contacted his tech support and they told me that's how cpanel works and that i could use rewrite rules to fix the problem. i found this really annoying since i figure there would be seo problems if you have 2 addresses with the same content. i read a bit on the net and i came up with this solution to remove the 2 urls created by the subdomain made by cpanel (2ndDomain.1stDomain.com and 1stDomain.com/2ndDomain.com):
RewriteCond %{HTTP_HOST} ^(www.)?2ndDomain.1stDomain.com [NC]
RewriteRule ^(.*)$ http://www.1stDomain.com/ [L,R=301]
RewriteCond %{HTTP_HOST} ^(www\.)?1stDomain\.com$
RewriteRule ^2ndDomain.com/(.*) http://www.1stDomain.com/ [R=301,L]
I'm guessing there must be other people ot there that have had this problem so let me know if this solution makes sense or what you did to fix this problem. thanks in advance!
