Jump to content


Photo

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


  • Please log in to reply
4 replies to this topic

#1 sagnik

sagnik

    Rank VI Member

  • Members
  • PipPipPipPipPipPip
  • 452 posts
  • Gender:Male
  • Location:Durgapur, West Bengal, India
  • Interests:Internet, Computer, Coding, Website Designing

Posted 08 April 2020 - 06:42 PM

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.
- By Sagnik

#2 wolstech

wolstech

    Rank X Member

  • Root Admin
  • 13,946 posts
  • Gender:Male
  • Location:Pennsylvania

Posted 08 April 2020 - 08:08 PM

cPanel does not support changing the main domain's document root. It must always point to public_html.


Please do not PM me for support. Posting on our forums lets all of us learn.
Do you play Minecraft? | Server Monitors | And the Dumbass of the Decade award goes to...


#3 sagnik

sagnik

    Rank VI Member

  • Members
  • PipPipPipPipPipPip
  • 452 posts
  • Gender:Male
  • Location:Durgapur, West Bengal, India
  • Interests:Internet, Computer, Coding, Website Designing

Posted 09 April 2020 - 07:00 AM

Okay, got it. Thank you for helping me out.
- By Sagnik

#4 Piotr GRD

Piotr GRD

    Rank IV Member

  • Contributors
  • 241 posts
  • Location:Stettin, Poland (Szczecin, Polska)

Posted 11 April 2020 - 08:27 PM

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.



#5 sagnik

sagnik

    Rank VI Member

  • Members
  • PipPipPipPipPipPip
  • 452 posts
  • Gender:Male
  • Location:Durgapur, West Bengal, India
  • Interests:Internet, Computer, Coding, Website Designing

Posted 12 April 2020 - 05:10 AM

Okay thank you very much.
- By Sagnik




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users