How do I change the root of a document in WHM?

How do I change the root of a document in WHM?

whm-change-document-root.md To properly edit an accounts DocumentRoot go to /var/cpanel/userdata/username/ (replace username with the actual cPanel username for the account), then edit the file domain.com (where domain.com is your primary domain name). Simply change both to the right path, then save the file.

How do I change the domain root directory in cPanel?

In the account Dashboard, click cPanel Admin. In the cPanel Home page, click Domains and then select Addon Domains. Under Modify Addon Domain, next to the domain you want to change, click the pencil. Enter a new document root, starting at your home directory, and then click Change.

What is the command to change the root directory?

To change into the root directory of Linux file system, use cd / . To go into the root user directory, run cd /root/ as root user.

How do I change document root main domain in cPanel namecheap?

To request the main domain change:

  1. Go to the Hosting List in the Namecheap account.
  2. Find the respective domain and click Manage next to the hosting package:
  3. On the next page, chose the Change Main Domain in the Account Actions drop-down menu:
  4. Enter the new domain name and agree to the disclaimers:

How do I change the root of a document?

8 Answers

  1. To change Apache’s root directory, run: cd /etc/apache2/sites-available.
  2. Then open the 000-default.conf file using the command: nano 000-default.conf.
  3. Edit the DocumentRoot option: DocumentRoot /path/to/my/project.
  4. Then restart the apache server: sudo service apache2 restart.

What is document root in cPanel?

The document root is the folder where the website files for a domain name are stored. Since cPanel allows for multiple domain names (addon domains and subdomains), you need to have a unique folder for each domain. Your primary domain is rooted in the public_html folder.

Can you change the hosting of a particular domain name?

The first time you registered a domain name for your website, you had to go through either a domain name registrar or a hosting provider. But if, for whatever reason – faster load times, smoother ease of use, cheaper renewal prices – you want to move your domain name from one host to another, it’s completely possible!

How to change the document root directory for an addon domain?

The second method uses .htaccess redirection, and can be configured in cPanel. If you want to change the document root directory for an addon domain, do not follow the procedures below. Instead, use cPanel to change the addon domain’s document root directory.

Can you change the root of a domain?

VERY IMPORTANT:Changing a primary domain’s document root is NOT RECOMMENDEDby InMotion Hosting. cPanel backup and restore packages use the default settings and will NOTsave your document root changes.

Where do I change the root folder in cPanel?

When you create a domain in your cPanel/WHM server, the document root for that domain would be ‘/home/user/public_html’ directory by default. While this is usually fine for most website owners, during certain special scenarios, they may need to change this folder to some other directory.

How to change the document root with root access?

Steps to Change the Document Root (with root access) When a VPS or Dedicated server customer needs to make a document root change, they can do so with Root Access. The steps below will explain how to change the document root of the primary domain, with root access.