D
D
Daniil Asanov2015-06-13 20:11:26
Domain name market
Daniil Asanov, 2015-06-13 20:11:26

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

3 answer(s)
S
ShamblerR, 2015-06-15
@ShamblerR

RewriteCond %{HTTPS} on
RewriteCond %{HTTP_HOST} ^domain\.ru$
RewriteCond %{HTTP_HOST} ^!test2\.domain\.ru
RewriteRule ^.*$ http://%{SERVER_NAME}%{REQUEST_URI}

! - deny

P
Puma Thailand, 2015-06-15
@opium

Write a redirect for only one domain without subdomains

S
Sergey N, 2015-06-18
@Albibek

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 question

Ask a Question

731 491 924 answers to any question