Site5 - Built For Designers & Developers MENU

How do I restructure the public_html directory?

[2 Grey Star Level]

By default, it appears that shared hosting will place the main domain associated with it into /public_html/, and any subdomains would be nested into it.

So test.example.com would reside in:
/public_html/test.example.com/

I find this structure distracting; I then have fully-fledged websites in subdomains residing on the same directory level as asset folders and other files for my main domain. This results in very awkward structure like this:

/public_html/blog.example.com/
/public_html/blog.example.com/assets/
/public_html/blog.example.com/index.php
/public_html/test.example.com/
/public_html/assets/
/public_html/libraries/
/public_html/scripts/
/public_html/index.php

This mixes up content from subdomains with the main site, and generally makes the whole thing unmanagable. Is there a workaround for this?

Answer #1

Hello,

Once the sub-domain has been setup, you can go back into the entry that was just added and change the Website Folder and point that wherever you like. Most people use a sub folder such as “subsites” and then have all of the sub-domain folders reside in there. Remember that it will still automatically create the folder in the public_html directory, so you can either need to move or delete this folder (check to make sure no files reside in this folder that you wish to keep) as you please. Once you change the website folder, the domain will no longer be pointed at the default location.

Do keep in mind that it can take up-to 2 hours for the dns changes to propagate.

Happy Hosting!

Answers Answered By: joliver [476 Blue Star Level]

Answer this Question

You must be Logged In to post an Answer.

Not a member yet? Sign Up Now »

Money Back Guarantees
Click to verify BBB accreditation and to see a BBB report.