Change root directory for the main domain?
Here's my situation:
[LIST]
I need a URL shortener
I like Polr best
Polr requires changing root directory to wherever_it_is_copied/public
I can't find a way to change the root directory for the main domain
My hosting plan doesn't allow add-on domains
So, do I have to forget about Polr or is there still light at the end of the tunnel?
-
Hello, For changing the main/primary domain, you will need to have root SSH access and be able to locate and edit the following file (replacing your user & domain info): /var/cpanel/userdata/USERNAME/DOMAIN.COM 1. Once you have opened the file, look for the following line: documentroot: /home/USERNAME/public_html 2. Modify the location according to your needs. Save it and exit. 3. Rebuild the Apache conf and restart Apache: /scripts/rebuildhttpdconf service httpd restart The change will be immediate. Simply clear your browser cache and force refresh the page! Regards, 1 -
Hello, You will need to reach out to your hosting provider to have them manually update the document root for the primary domain name, using the instructions in the previous post. It's not possible to make this change without root access to the system. Thank you. 0 -
Hello, For changing the main/primary domain, you will need to have root SSH access and be able to locate and edit the following file (replacing your user & domain info): /var/cpanel/userdata/USERNAME/DOMAIN.COM 1. Once you have opened the file, look for the following line: documentroot: /home/USERNAME/public_html 2. Modify the location according to your needs. Save it and exit. 3. Rebuild the Apache conf and restart Apache: /scripts/rebuildhttpdconf service httpd restart The change will be immediate. Simply clear your browser cache and force refresh the page! Regards,
I have followed this but still it resolves to old website. I even restarted the entire server and in cPanel > Domain it says the new document root has been applied. There must be another place this needs to be edited?1 -
@Ben Taylor - could you start a new thread with specific details on your issue? 0 -
There must be another place this needs to be edited?
You also need to change the documentroot line in the /var/cpanel/userdata/USERNAME/DOMAIN.COM_SSL file.0
Please sign in to leave a comment.
Comments
5 comments