I had two domains on one hosting account, managed by cpanel. During the second domain installation I opted to use root folder outside public_html because the second site was going to have independent ftp administration not related to the one of the first domain at all. So I didn't want the files of the second site to be accessible in public_html. That worked pretty well until the second domain expired and wasn't going to be renewed. However, despite website isn't public already, I want to have web access on it for testing and other purposes but it seems like cpanel doesn't allow subdomain directories outside public_html. Is there a way, to achieve that without having to migrate all subdomain files to public_html and thus - making them accessible for the administrators on the main domain (which is undesired)?
Asked
Active
Viewed 7,504 times
2
-
It is Bulgarian hosting provider "Superhosting". – lrd Dec 31 '14 at 16:12
-
It depends on your host if this is allowed, but here's how to do it if it is possible: http://www.inmotionhosting.com/support/edu/cpanel/cpanel-manage-domains/modify-addon-domain-document-root – tsg Dec 31 '14 at 16:14
-
Isn't that for independent (bought) domain names? If so, it works for them. But I need to make a subdomain (example: subdomain.maindomain.whatever) extending the only remaining domain assigned to the account. Edit: Your example points public_html as main folder too. – lrd Dec 31 '14 at 16:20
2 Answers
0
One way you can do this is by having two cPanel hosting accounts:
- domain.com
- subdomain.domain.com
In case the hosting accounts are in different servers, you should make an A record
subdomain.domain.com
pointing to the server that specific hosting account is created.
By doing that, you will have two separated environments, usernames, passwords and databases will be different from each other. The hosting account domain.com won't be able to see the files and manage anything on subdomain.domain.com. The same applies vice-versa.

munich
- 500
- 1
- 6
- 16
-
That means purchasing another hosting plan (I am tired of free web hosting restrictions and inconveniences). The better (cheaper) way would be buying another domain name. – lrd Jan 03 '15 at 07:14
-1
create folder out side www as for example hello
. and in cpanel/subdomains
point that such as ../hello
in Document Root