Subdomain outside of public_html
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
-
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. 0 -
It is possible, but only if your host allows for it. They'd need to go to WHM > Tweak Settings > Domains > Restrict document roots to public_html and disable it. When the setting is disabled, you can have a document root anywhere in your homedir. 0 -
Agree with @DennisMidjord however, you still won't also be able to access the subdomain as mysite.com/mysubdomain without some kind of rewrite. 0 -
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 0
Please sign in to leave a comment.
Comments
4 comments