1

I have the same problem than: WIldcard SSL Subdomain Not Pointing at Correct DocumentRoot but the answer does not help me.

I have a Wildcard SSL installed on my Apache server.

With HTTP :

  • www.example.com points to documentroot /home/example/public_html OK
  • sub.example.com points to documentroot /home/sub_example/public_html OK

Now with HTTPS:

  • www.example.com points to documentroot /home/example/public_html OK
  • sub.example.com points to documentroot /home/example/public_html (NOK: same as main domain above).

I have checked the .conf files into /etc/apache2/sites-available and they are OK, at least for the documentroot directive.

Why subdomain points to the main domain documentroot? and this only when SSL?

THANKS

0

It sounds like a virtual host configuration issue. Have a look at the output of apache2 -S.

On Ubuntu I had to source some environment variables first and ran: ( . /etc/apache2/envvars ; apache2 -S )

| improve this answer | |
  • Thanks to the command "apache2ctl -S", I saw there was an IP misconfiguration: subdomain had not the same IP than main domain. Now this is corrected. – Bruno de Goyrans Jun 5 '15 at 11:05
  • But now, when I go to subdomain, the browser says this is a selfsigned certificate. Subdomain does not take the maindomain certificate, although this is a wildcard certificate. – Bruno de Goyrans Jun 5 '15 at 11:09
  • 1
    I had to recopy the certificate files in the subdomain directory. Now everything just work fine. And I have the green padlock. This apache2ctl -S command really helped me. :) – Bruno de Goyrans Jun 5 '15 at 12:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.