Page 1 of 1

DocumentRoot does not change for HTTPS site

Posted: Fri 24. Aug 2018, 20:00
by sburina
Hi!

I tried to configure a different DocumentRoot for a site, adding ./public/ directory within the existing www, by using the "Folder explorer". After the change has been submitted, the DocumentRoot directive changes in the apache configuration, but only for the HTTP (first VirtualHost), and within the second VirtualHost (port 443) the DocumentRoot pathis left unchanged. If changed manually, it reverts to the wrong value after any intervention on that config via the web interface.

Thank you in advance!

Re: DocumentRoot does not change for HTTPS site

Posted: Mon 3. Sep 2018, 10:11
by Alexander
Hello,

you write first "VirtualHost" and "second VirtualHost" - Because of this hint i came up with the following explanation, KeyHelp is working correctly in this case, but you may not be aware of the settings you made.


When you have a Domain example.com and a subdomain www.example.com. Both will have their own vhost container with their own path. And they exist for HTTP and HTTPS (if available). Because of this, you can let example.com point to "directory_a" and www.example.com to "directory_b".

When opening the apache config file for this particular user, the order would always be HTTPS container -> HTTP container.

I guess the following happen in you example:
You have a not SSL protected example.com and a SSL protected www.example.com. And you only changed the path for www.example.com,, and not also for example.com

The order inside of the config file would look like this:

Code: Select all

<VirtualHost *:80>
  ServerName example.com
  DocumentRoot "/home/users/<USERNAME>/www/"
  ...
</VirtualHost>  

<VirtualHost *:433>
  ServerName www.example.com
  DocumentRoot "/home/users/<USERNAME>/www/public/"
  ...
</VirtualHost>  

<VirtualHost *:80>
  ServerName www.example.com
  DocumentRoot "/home/users/<USERNAME>/www/public/"
  ...
</VirtualHost>  

Solution A)
Lets example.com also point to the "/public/" directory, like www.example.com

Solution B)
When you only want to use www.example.com, let example.com point directly to www.example.com with a redirect. Just input "https://www.example.com" into the "Target" input field inside of the settings of example.com
This is the better approach concerning SEO.

----

If this does not help you, it may be a bug, please supply your apache config file of this user in this post or via PM.

Re: DocumentRoot does not change for HTTPS site

Posted: Wed 12. Sep 2018, 14:02
by majorboobage
Talking about ssl, keyhelp.de doesn't have cert
Image

Re: DocumentRoot does not change for HTTPS site

Posted: Fri 12. Oct 2018, 16:18
by v3ng
majorboobage wrote: Wed 12. Sep 2018, 14:02 Talking about ssl, keyhelp.de doesn't have cert
Image
No problems here.
Image

Re: DocumentRoot does not change for HTTPS site

Posted: Tue 16. Oct 2018, 09:50
by Alexander
Thanks for bringing this up @majorboobage
And thanks for the reminder @v3ng (I hadn't been thinking about it any more :oops: )

Majorboobage was right, there was a misconfiguration when calling https://keyhelp.de / https://keyhelp.eu (without www).
This is now fixed.