Howdy, Stranger!

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


New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Setting Apache virtual host for https://www ?

So basically my site is working normally, but i am hosting multiple sites on a server.

If i view the site at https://site.domain, then i can see the page normally. BUT
if the site is visited through https://www.site.domain, THEN it displays another page that i am also hosting(it takes different root directory it seems!???)

How do i set up my virtual host to either disable https://www or so that it points correctly to the right site directory? Thanks!

`
ServerName site.domain
ServerAlias site.domain
ServerAdmin [email protected]
DocumentRoot /var/www/site.domain/public_html

<Directory /var/www/site.domain/public_html>
    Options -Indexes +FollowSymLinks
    AllowOverride All
</Directory>

ErrorLog /var/log/httpd/site.domain.com-error.log
CustomLog /var/log/httpd/site.domain-access.log combined


`

Comments

  • ServerAlias www.site.domain would do

  • KassemKassem Member

    Make sure to rerun certbot and get certificates for the www. subdomain too.

Sign In or Register to comment.