Child Domains outside of public_html folder — CyberPanel - WebHosting Control Panel for OpenLiteSpeed

Child Domains outside of public_html folder

Would be nice to be able to set child domains outside of public_html folder, this way you can organize better your website.


  • edited April 2020
    I agree! I was hoping that my sub-domain could be at the same directory level as public_html, ie with path /home/ (instead of /home/ The current structure is limiting what can be installed on the sub-domain, for that reason I might have to switch control panels.
  • Agree. It will be good if the user decides where to put the location.
  • I can add it as feature but in v2.0.1. Dev already stopped for v2.0.0. Will create new branch today.
  • I started a laravel project in the domain name. I have to specify public_html / project / public path so that I can use it in the main domain. I have a subdomain. It is also included in public_html. I have to map the main domain start folder to the public folder of the laravel project without affecting it.
  • @AnAlien

    I've added this feature in the v2.0.1 branch just now. But this will be the current active dev branch moving forward.

    You can either install or upgrade to this version when asked for version prompt.
  • ok I accidentally opened the topic again. can you close
  • When does the 2.0.1 stable version come? @usmannasir
  • @AnAlien

    It may take 1-2 months, I just created the branch. v2.0.0 just released few days ago.
  • I did some research and put the pieces together. I found a way. It doesn't tire us. It does not spoil the existing. @usmannasir @CyberPanel @w3services @hennaboy @Alexbruma @NickW

    Your HTACCESS file edit;

    RewriteEngine On
    RewriteBase /your-sub-dir

    RewriteCond %{SERVER_PORT} 80
    RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]

    RewriteCond %{THE_REQUEST} /your-new-public-file-name/([^\s?]*) [NC]
    RewriteRule ^ %1 [L,NE,R=302]
    RewriteRule ^(.*)$ your-new-public-file-name/index.php?$1 [L,QSA]
  • @AnAlien yes path changes can be accomplished using .htaccess rewrite rules and maybe that's a solution for some. However for security I believe it's recommended to locate Laravel application files outside public folders, ie above public_html; Yes the rewrite rule would prevent access, unless .htaccess got deleted.

    @hennaboy updating vhost conf would be safer but I've have to do that each time I added a new child-domain.

    @Alexbruma sorry for hijacking your post but we seemed to have the same issues.

    @usmannasir thank you for the update on github much appreciated! Since mine's a fresh install, I will try applying the updates in files website.html and as shown at to my installed files (deleting my existing child domain first).
  • I can't find an option to delete a child domain, only the main domain, am I missing something? The documents at seem look like they relate to an earlier version.
  • Found delete a child domain under main domain Manage > Domains list
  • What I tried on v2.0
    - create the subdomain > add domains (with default settings)
    - move the previously created folder > file manager > move to /home/
    You'll get home/
    - edit vHost Conf
    docRoot /home/

    - Now I have one last problem to resolve - Rewrite rules
    cat: /home/ No such file or directory

    I can't figure where it's defined the .htaccess path
  • edited May 2020
    more updates about.
    - Litespeed load the correct .htaccess file from the new folder defined in vHost. That's good. Seams that only Cyperpanel in the website management page can't read the new location because in the child domains path it registered the original path from child domain creation.
    The path from List Domains:

    - Also after we change the docRoot to the new location outside /public_html/
    Failed to obtain SSL

    Will be interesting to see what would happen when the actual SSL expire and the new one should be obtained.
Sign In or Register to comment.
CyberPanel Discord

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!