Answer the question
In order to leave comments, you need to log in
How to change virtualhosts so that there is no redirect from the main one?
When accessing the site, redirects for https and www are configured. The site only works with https://www or a redirect.
I'm not a configuration wizard and I guess that you can configure it more competently, but the option works fine.
<VirtualHost *:80>
ServerName domain.com
ServerAlias www.domain.com
Redirect permanent / https://www.domain.com/
</VirtualHost>
<VirtualHost *:443>
ServerName domain.com
Redirect permanent / https://www.domain.com/
</VirtualHost>
<VirtualHost *:443>
ServerName www.domain.com
DocumentRoot /var/www/domain.com/site
</VirtualHost>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question