Subdomain and Document Root Help
Hi,
I"m having some problems and wondering if anyone can help me please.
I have setup the following subdomain with the document root:
clients.domain.tld > /public_html/clients
I want the content to be only available via the URL "clients.domain.tld" but right now it is also accessible via the URLs "www.domain.tld/clients" and "domain.tld/clients". How can I disable the latter 2 URLs so that it is only possible through the subdomain only?
Thank you.
-
So those latter two URLs are present because the folder for the subdomain exists inside the root domain's document root. The only way to avoid this would be to move the data outside the document root - so outside of public_html and into /home/$user/ 0 -
Thank you @cPanelLauren, I did think of that but then thought that maybe it won't be accessible via the web. Will try it and if there's any issues I'll ask here. 0 -
@cPanelLauren tried your suggestion, but unfortunately the document root cannot be outside of public_html. It just isn't physically possible. Any other suggestions? 0 -
It is possible but it may be that your provider has restricted document roots to public_html which is a setting that can be changed in WHM's Tweak Settings interface. Otherwise, it's not possible to do as far as I am aware - besides redirecting domain.tld/folder to sub.domain.tld which is possible to do in the cPanel interface. 0
Please sign in to leave a comment.
Comments
4 comments