Answer the question
In order to leave comments, you need to log in
How to make a redirect from HTTP to HTTPS, but only for the .RU domain, and not for the .KZ mirror + specific Rucenter hosting?
Good afternoon.
Please tell me htaccess file experts.
There is a site with an SSL certificate, say - sport.ru
It has several mirror subdomains:
msk.sport.ru
spb.sport.ru
And also, there is a mirror for Kazakhstan sport.kz + one subdomain almaty.sport.kz - without SSL certificate.
This site lives on NIC.ru and there, if I understand correctly, only this entry works for redirecting from HTTP to HTTPS:
RewriteCond %{SERVER_PORT} !^443$
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI } [R,L]
Answer the question
In order to leave comments, you need to log in
RewriteCond %{SERVER_PORT} !^443$
RewriteCond %{HTTP_HOST} !^не такой домен [NC]
RewriteCond %{HTTP_HOST} !^и не такой не такой домен [NC]
RewriteCond %{HTTP_HOST} !^и так далее [NC]
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
RewriteCond %{SERVER_PORT} !^443$
RewriteCond %{HTTP_HOST} ^sport\.ru [NC]
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question