Nishant80

Well-Known Member
May 7, 2012
64
0
56
cPanel Access Level
Root Administrator
Hello,
I created a subdomain called subdomain.domain.com and the directory was placed under "/public_html/subdomains". Now, my confusion is that the subdomain can be access by both the URLS, i.e. subdomain.domain.com AND domain.com/subdomain.

However, I just want the subdomain to work, I don't want people to be able to access the subdomain via domain.com/subdomain. How can I accomplish this?

Note - Setting up domain redirection isn't working as its generating a loop error.
 

quietFinn

Well-Known Member
Feb 4, 2006
1,902
466
438
Finland
cPanel Access Level
Root Administrator
However, I just want the subdomain to work, I don't want people to be able to access the subdomain via domain.com/subdomain. How can I accomplish this?
What if you don't tell people that it's possible?
 

quietFinn

Well-Known Member
Feb 4, 2006
1,902
466
438
Finland
cPanel Access Level
Root Administrator
That is always there, but there always are those "curious" people who try a lot of things. And there has to be a way around for this, no?
The best thing to do is to place the sudomain in /home/CPANELUSERNAME/subdomain directory instead of /home/CPANELUSERNAME/public_html/subdomain.
 

Nishant80

Well-Known Member
May 7, 2012
64
0
56
cPanel Access Level
Root Administrator
The best thing to do is to place the sudomain in /home/CPANELUSERNAME/subdomain directory instead of /home/CPANELUSERNAME/public_html/subdomain.
Yeah I've thought of that before. It wouldn't cause any technical issues later right? Since the source is not within public_html?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,261
463
The best thing to do is to place the sudomain in /home/CPANELUSERNAME/subdomain directory instead of /home/CPANELUSERNAME/public_html/subdomain.
This is correct. It's fully supported to create the subdomain with it's document root outside of the traditional public_html directory. You should not encounter any issues when doing this.

Thank you.