FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Htaccess question: hiding cpanel subdomains





inphurno
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!
inphurno
I'm sure I'm not the only person here who has or takes care of hosting elsewhere then frihost. so i'm wonder has no one ever run into this problem before?

from what i can tell cPanel hosting is pretty common but no one ever try to setup more than one domain with this type of web admin interface? Please guys and gals any help with this would really great for our non-profit org so that we can figure out what to do for our hosting.
raver
That's the way cpanel works, and i don't see why it would represent a problem.
Let's say we have www.domain1.com as main domain, with the files in /public_html
Now we buy a second domain, www.domain2.com and set it up as an addon to the main domain.
The files will be in /public_html/domain2
BUT search engines have no way of knowing that the site is there unless you link it accordingly, so they will never go to www.domain1.com/domain2
inphurno
someone else told me this answer as well but if some one submits this url to google then you are in a bit of problem no?

edit: 400th post Very Happy
Fire Boar
inphurno wrote:
someone else told me this answer as well but if some one submits this url to google then you are in a bit of problem no?

edit: 400th post Very Happy


But if nobody knows about the url, then there's not much chance of that happening, right?
Related topics
.htaccess tutorial
Features of FRIHOST
A Question For .htaccess
Must cpanel be 2082? I can't connect
Cpanel Question. Very serious.
How to access CPanel/DirectAdmin from behind a firewall
Cpanel Acess... again!
Can't login
Quick Cpanel Question
htaccess question...
Direct admin question - Pointing domains to subdomains.
Htaccess Question
PHP that creates subdomain, ftp account, and mysql database?
.htaccess question
Reply to topic    Frihost Forum Index -> Scripting -> Others

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.