Change the default main domain folder to sub-folder

Change the default main domain folder to sub-folder

Many web hosting providers, for example  BlueHost and  JustHost,  allow customers to host more than one domain from a single purchase (add-ons). Add-on domains usually point itself to a sub-folder under public_html or www. However, the main domain recognizes public_html as its root, which may lead to some development issues.  This article explains why it is good to have the main domain sitting under a sub folder and how to do code to make it in action.

The Benefits

Having main domain sitting in sub directory, it will be easy for website maintenance purpose. For example, you can make a backup/restore of files in the main domain with out interrupt the add-ons domain’s files. For example, if you have main domain under root of public_html, once you make zip to compress public_html folder, everything including add-ons’ files will be zipped and they all will be reset when you restore (you can’t restore it separately ).

Read More