Reputation: 302
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)?
Upvotes: 2
Views: 8360
Reputation:
create folder out side www as for example hello
. and in cpanel/subdomains
point that such as ../hello
in Document Root
Upvotes: -1
Reputation: 530
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.
Upvotes: 0