Imagine you have a user named somecorp with the domain example.com:
Home directory: /home/somecorp
Web root: /home/somecorp/public_html
www.example.com - would be served out of /home/somecorp/public_html
Now he wants to add somesub.example.com
If you put it in public_html like this:
/home/somecorp/public_html/somesub/
then going to www.example.com/somesub will navigate to it. It also looks confusing in the web root - is "somesub" a directory in the main www.example.com web root, or is it a separate subdomain?
Unfortunately, putting it outside public_html breaks things.
I wish you could setup like this:
public_html/example.com - www.example.com
public_html/somesub.example.com
public_html/somethingelse.com
etc.
...where each of those is a web root. Alas.
So how do you do subdomains? Any "best practice"?
Home directory: /home/somecorp
Web root: /home/somecorp/public_html
www.example.com - would be served out of /home/somecorp/public_html
Now he wants to add somesub.example.com
If you put it in public_html like this:
/home/somecorp/public_html/somesub/
then going to www.example.com/somesub will navigate to it. It also looks confusing in the web root - is "somesub" a directory in the main www.example.com web root, or is it a separate subdomain?
Unfortunately, putting it outside public_html breaks things.
I wish you could setup like this:
public_html/example.com - www.example.com
public_html/somesub.example.com
public_html/somethingelse.com
etc.
...where each of those is a web root. Alas.
So how do you do subdomains? Any "best practice"?