Answer the question
In order to leave comments, you need to log in
Redirect HTTPS, WWW. How?
Hi guys! My site
was at www.site.ru. Connected an SSL certificate for site.ru . Now I need to redirect http > https and also www to non-www.
The options below work. But the redirect from httpS://WWW.site.ru does not work .
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.site.ru$ [NC]
RewriteRule ^(.*)$ https://site.ru/$1 [R=301,L]
RewriteCond %{HTTPS} off
RewriteCond %{HTTP :X-Forwarded-Proto} !https
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI } [L,R=301]
What should I do? Thank you!
Answer the question
In order to leave comments, you need to log in
RewriteEngine On
RewriteCond %{HTTP_HOST} !^site.ru$ [NC,OR]
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://site.ru$1 [R=301,L]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question