Answer the question
In order to leave comments, you need to log in
How to write a 301 redirect to https in htaccess?
Now I have a redirect from www to without www:
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^site\.ru [NC]
RewriteRule (.*) http://site.ru/$1 [R=301,L]
Answer the question
In order to leave comments, you need to log in
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^site\.ru [NC]
RewriteCond %{REQUEST_SCHEME} http [NC]
RewriteRule (.*) https://site.ru/$1 [R=301,L]
And google not?
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question