Subdomain outside of public_html

kimass

Registered
Jun 18, 2019
1
0
1
Serbia
cPanel Access Level
Website Owner
Hi,

I have shared hosting with one main website (wordpress) and a couple of subdomains. Main site is in the root (public_html).

When I install subdomain, cpanel put the instalation here: mysite.com/mysubdomain. I would like to have complete subdomain instalation files out of public_html, but keep the url mysite.com/mysubdomain.

Thanks for your help.

Best regards
 

GOT

Get Proactive!
PartnerNOC
Apr 8, 2003
1,774
328
363
Chesapeake, VA
cPanel Access Level
DataCenter Provider
I do not think that would be possible. You might be able to get away with manually creating that folder in your public_html and then use a url rewrite in the htaccess to rewrite it back to the subdomain.
 

GOT

Get Proactive!
PartnerNOC
Apr 8, 2003
1,774
328
363
Chesapeake, VA
cPanel Access Level
DataCenter Provider
Agree with @DennisMidjord however, you still won't also be able to access the subdomain as mysite.com/mysubdomain without some kind of rewrite.
 
  • Like
Reactions: DennisMidjord

cPanelLauren

Product Owner II
Staff member
Nov 14, 2017
13,266
1,301
363
Houston
The only reason mysite.com/mysubdomain works is because that folder is within the documentroot for mysite.com. As noted by @GOT you'd need a rewrite in place to retain this URL if the mysubdomain folder is outside of public_html