Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the copy-the-code domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/html/pcx3.com/wp-includes/functions.php on line 6121

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the pb-seo-friendly-images domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/html/pcx3.com/wp-includes/functions.php on line 6121

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the johannes domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/html/pcx3.com/wp-includes/functions.php on line 6121
How to Change root directory from public_html for the main domain in cPanel - PC✗3
How to Change root directory from public_html for the main domain in cPanel

How to Change root directory from public_html for the main domain in cPanel

on cPanel by default the main domain name has public_html for the root directory, but can it be changed?

Sure, here is a guide on how to change root directory from public_html for the main domain in cPanel.

Edit the following files:

/var/cpanel/userdata/USERNAME/DOMAIN.COM

under documentroot set path to the new directory and save changes:

change root path DOMAIN.COM
change root path DOMAIN.COM

If your website uses SSL (and who doesn’t ) do the same for the following file:

/var/cpanel/userdata/USERNAME/DOMAIN.COM_SSL
change root path DOMAIN.COM_SSL
change root path DOMAIN.COM_SSL

Save the file after changes are made and then delete the cache file for your primary domain.

rm -vf /var/cpanel/userdata/USERNAME/DOMAIN.COM_SSL.cache

Run the following scripts to update any user data cache and rebuild apache configuration file

/scripts/updateuserdatacache
/scripts/rebuildhttpdconf

and finally restart Apache server to load changes.

service httpd restart
whoami
Stefan Pejcic
Join the discussion

I enjoy constructive responses and professional comments to my posts, and invite anyone to comment or link to my site.