DocumentRoot does not change for HTTPS site

Locked
User avatar
sburina
Posts: 11
Joined: Tue 19. Jun 2018, 00:25

DocumentRoot does not change for HTTPS site

Post 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!
User avatar
Alexander
Keyweb AG
Posts: 3842
Joined: Wed 20. Jan 2016, 02:23

Re: DocumentRoot does not change for HTTPS site

Post 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.
Mit freundlichen Grüßen / Best regards
Alexander Mahr

**************************************************************
Keyweb AG - Die Hosting Marke
Neuwerkstr. 45/46, 99084 Erfurt / Germany
http://www.keyweb.de - http://www.keyhelp.de
**************************************************************
majorboobage
Posts: 37
Joined: Thu 26. Jul 2018, 08:51

Re: DocumentRoot does not change for HTTPS site

Post by majorboobage »

Talking about ssl, keyhelp.de doesn't have cert
Image
User avatar
v3ng
Posts: 297
Joined: Wed 4. Jul 2018, 18:08

Re: DocumentRoot does not change for HTTPS site

Post by v3ng »

majorboobage wrote: Wed 12. Sep 2018, 14:02 Talking about ssl, keyhelp.de doesn't have cert
Image
No problems here.
Image
User avatar
Alexander
Keyweb AG
Posts: 3842
Joined: Wed 20. Jan 2016, 02:23

Re: DocumentRoot does not change for HTTPS site

Post 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.
Mit freundlichen Grüßen / Best regards
Alexander Mahr

**************************************************************
Keyweb AG - Die Hosting Marke
Neuwerkstr. 45/46, 99084 Erfurt / Germany
http://www.keyweb.de - http://www.keyhelp.de
**************************************************************
Locked