InMotion Hosting Support Center

InMotion Hosting is able to change the Document root location where your Primary domain points to. This allows the file structure to be maintained how the developer wants to reference the files in the website code. This article will explain how to get the document root changed for your primary domain.

VERY IMPORTANT! Changing a primary domain doc root is NEVER RECOMMENDED by InMotion Hosting. cPanel restores packages based on default settings and miss document root changes. So if the account is moved, the accounts with the doc root change may break.

Accounts on Shared servers

Shared server accounts cannot change their document root, because root access is not allowed on Shared servers. Our tech support can change the document root on your shared server account per your request. You will need to submit this in a ticket to support with the folder (path to the directory location) you want to change the document root to.

VPS and Dedicated servers

When an VPS or Dedicated server customer needs to make a document root change, they can with Root Access. Below will explain how to change the document root of the primary domain.

Changing the Document Root (without root access)

VPS and Dedicated customers that do not have root access cannot change the document root of their main domain. VPS and Dedicated server customers without root access will need to follow the same process as the Shared server customers. In order to have the main domain changed on your server, you will need to contact tech support with the request.

Steps to change the Document Root (with root access)

VERY IMPORTANT!We do not support changes done as the ROOT user. Any time required by the system administration team to repair, troubleshoot, or restore services due to changes made (as a result of having root access) after taking root access may be billed at rate of up to $75/hr. This does not guarantee resolution of technical issues deemed outside the scope of our support.

  1. ssh
  2. sudo su - root
  3. Edit the following file:

    Important! If you have an SSL certificate on the account, you may need to edit the following file as well.


    You should see the file like the following. The areas to edit are in RED.

           format: combined
           target: /usr/local/apache/domlogs/
           format: "\"%{%s}t %I .\\n%{%s}t %O .\""
           target: /usr/local/apache/domlogs/
       documentroot: /home/USER/public_html
       group: USER
       hascgi: 1
       homedir: /home/USER
       owner: root
       phpopenbasedirprotect: 1
       port: 80
           path: /home/USER/public_html/cgi-bin
           url: /cgi-bin/
       usecanonicalname: 'Off'
       user: USER
    Change the following lines in the file:
       documentroot: /home/USER/public_html
       path: /home/USER/public_html/cgi-bin
    The changes will look like the following:
       documentroot: /home/USER/public_html/new_doc_root_dir
       path: /home/USER/public_html/new_doc_root_dir/cgi-bin
  4. When finished editing the document root, run the following scripts while logged in as the ROOT user.:
       service httpd graceful

Support Center Login

Social Media Login

Social Login Joomla

Related Questions

Here are a few questions related to this article that our customers have asked:
Change document root for primary domain
Why is my domain pointing to a directory inside public_html?
Would you like to ask a question about this page? If so, click the button below!
Ask a Question

Post a Comment

Email Address:
Phone Number:

Please note: Your name and comment will be displayed, but we will not show your email address.

0 Questions & Comments

Post a comment

Back to first comment | top

Need more Help?


Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail:
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!