Jump to content

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


sagnik

Recommended Posts

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.

Link to comment
Share on other sites

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
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...