Cannot Change Root Directory for Main Domain - 82.0.16

xzenocrimzie

Registered
Oct 13, 2019
1
0
1
Canada
cPanel Access Level
Root Administrator
Hello all.

I am migrating a site to CentOS 7, Cpanel 82.0.16. To set up the site, I am wanting my public_html to be set up like so:

Code:
public_html
-> 1sub.example.com
-> 2sub.example.com
-> example.com
Where the directory root of the main domain is set for ./public_html/example.com. In order to accomplish this, I have enacted the changes shared in this thread:

I have changed the documentroot line to "/home/USERNAME/public_html/example.com", as well as the cgi-bin line to the same.

However, after committing these changes, as well as rebuilding and restarting apache, the server is not redirecting browsers correctly. In firefox, it throws the error:

Code:
The page isn’t redirecting properly

Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

    This problem can sometimes be caused by disabling or refusing to accept cookies.
To attempt to rectify a possible issue with the domain not using the www. prefix, I have committed the following code to an .htaccess file in ./public_html

Code:
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www\.(.*) [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
order allow,deny
allow from all
Ideally, one would be able to adjust the directory root natively in WHM or CPanel, but I have not found a method to do that.

Thank you for any help you'll be able to give.
 
Last edited by a moderator:

cPanelLauren

Product Owner II
Staff member
Nov 14, 2017
13,266
1,309
363
Houston
Can you please open a ticket using the link in my signature? Once open please reply with the Ticket ID here so that we can update this thread with the resolution once the ticket is resolved.


Thanks!