KNOWNHOST WIKI

User Tools

Site Tools


control-panels:directadmin:how-to-upload-to-private-html

My Site Via HTTPS Shows "To change this page, upload a new index.html to your private_html folder"

With DirectAdmin, you could technically have two different sites for the same domain depending on whether or not you use http or https. The http site is loaded from public_html and the https site is loaded from private_html. If you've setup your site with the standard public_html and installed a SSL for your site, you may now see the following when attempting to visit the site via https:

You probably don't want to upload a new site as instructed in the message because of disk space, and you don't have to. Simply use DirectAdmin to make a private_html → public_html symlink for you.


Follow these instructions to make the symlink:

  • Log into DirectAdmin as the user that owns the domain and navigate to "Domain management".
  • Click your domain you need to make modifications for.
  • Now, click 'private_html setup' near the top right corner next to "PHP Version Selector".

  • Select the option "Use a symlink from private_html to public_html - allows for same data in http and https" and Save.

Now, your directory structure for the domain will have changed like so and the exact same content will be loaded for http and for https:


Like manage others, you may have no desire to ever have two separate sites hosted via https and http. You may also find this extra step unnecessary and feel that this should be already done by default. If that is the case, have DirectAdmin automatically setup the symlink for you upon domain creation.

Follow the instructions below to configure this.

  • Log into the server as the root user via SSH. Remember that KnownHost configures the server to use port 2200 by default to help deter automated SSH login abuse.
  • Check to ensure that this option is not enabled:
  [root@host newdomain.tld]# /usr/local/directadmin/directadmin c | grep private               
  default_private_html_link=0
  [root@host newdomain.tld]# 
  • If not, enable it by changing it from '0' to '1':
  [root@host newdomain.tld]# /usr/local/directadmin/directadmin set default_private_html_link 1 restart
  default_private_html_link=1
  [root@host newdomain.tld]# 

That's it! The symlink will now be created automatically for you by default.

control-panels/directadmin/how-to-upload-to-private-html.txt · Last modified: 2020/06/01 11:03 by Karson N.