Domains and DNS

Host a new domain in public_html or in the account root

Reviewed on 2 min read addon domains directories

When you add a domain in cPanel you can choose the folder where its website will live. The two most common options are:

  • Inside public_html: /public_html/nuevodominio.com
  • In the account root: /nuevodominio.com

Technically both work the same way. Choosing one or the other is mostly a matter of tidiness.

The difference

public_html is the primary domain's folder. If you put the other domains in there, their folders get mixed up with the primary website's files and it is harder to tell what belongs to what.

Also, a website in public_html/nuevodominio.com can also be opened as dominioprincipal.com/nuevodominio.com, and it is affected by the rules in the primary website's .htaccess (redirects, maintenance mode, protections...). If an additional website ever does strange things that have nothing to do with it, check that .htaccess.

That is why many customers prefer to keep public_html for the primary domain only and put the rest in the root:

dominioprincipal.com -> /public_html
dominio1.com         -> /dominio1.com
dominio2.com         -> /dominio2.com

Other ways to organise it

The structure is flexible. You can also group the websites in a folder:

/webs/dominio1.com
/webs/dominio2.com

Or by customer or company:

/empresa1/dominio1.com
/empresa1/dominio2.com
/empresa2/dominio3.com

You just have to type that path in the folder field when you create the domain; if it does not exist, cPanel creates it. The account root is your home folder (/home/tuusuario), not the server's root. Do not use folders that already have another purpose, such as mail, etc, logs or tmp.

If you have already created the domain and want to move it, follow how to change an additional domain's path.

Bear in mind that all the websites in the same account share a user: separating them into folders keeps them tidy, but if one gets infected it can affect the others. If you manage websites for different customers, it is safer to give them separate hosting accounts.

You may also find useful

Something wrong or out of date? Tell us and we will review it.