Jump to content

[Solved] Can the Document Root of my main domain be changed?


Recommended Posts

Posted

Hello Admins, I request you to change the document root of my main domain as I've too many addon-domains it will be better to keep them organized. So kindly give a response telling that if it's possible or not. Because I don't know how the websites are hosted in heliohost but if the websites are configured as VirtualHosts then it might be possible. I know that there are some rules for every request, I don't know if my request complies with the rules of heliohost as I've not seen such a rule there, it's also possible that I might be the first one here who's requesting to change the document root of the main domain.

Posted

Okay, got it. Thank you for helping me out.

Posted

This *is* annoying in cPanel.

But there are two other options (only second one is possible on HelioHost) to have all domains files (including main one) in separate folders.

 

First option to deal with it in cPanel is to have all addon domains pointed to the folders outside of the main public_html. This is *intentionally* not possible on HelioHost.

 

Second option is to use .htaccess rewrite engine. Create new "maindomainfolder" folder inside of public_html, move all main domain files in there and directly in public_html create .htaccess with something like:

RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^(www\.)?maindomain\.com$
RewriteRule ^(.*)$ /maindomainfolder/$1 [L]

There may be conflict with other rewrite rules in other .htaccess files inside that folder, some modifications of them may be needed to reflect folder changes.

  • Like 1
Posted

Okay thank you very much.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...