Answer the question
In order to leave comments, you need to log in
SSL on the main domain interferes with my subdomains, what should I do?
When I set up a redirect from http to https in the .htaccess file, this also affects subdomains, and they do not have a certificate, which is why it says that the site is unsafe.
Answer the question
In order to leave comments, you need to log in
RewriteCond %{HTTPS} on
RewriteCond %{HTTP_HOST} ^domain\.ru$
RewriteCond %{HTTP_HOST} ^!test2\.domain\.ru
RewriteRule ^.*$ http://%{SERVER_NAME}%{REQUEST_URI}
The certificate is issued for a defined domain, subdomains are not included there.
If you cannot exclude the use of subdomains, for example by replacing sub.domain.ru with domain.ru/sub, then the correct action would be to issue new certificates.
Options:
Depending on the number of subdomains, I advise you either the first or the second method. If there are a lot of subdomains or they are dynamic, use wildcard.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question