Created
August 5, 2019 10:02
-
-
Save inpromotion/454283031f5a9f5b6fb78f54f50ceaa4 to your computer and use it in GitHub Desktop.
Редирект с www на без www + редирект на https
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC] | |
RewriteRule ^ https://%1%{REQUEST_URI} [R=301,L] | |
RewriteCond %{HTTP:X-Forwarded-Proto} =http [OR] | |
RewriteCond %{HTTP:X-Forwarded-Proto} ="" | |
RewriteCond %{HTTP:X-HTTPS} !1 [OR] | |
RewriteCond %{HTTPS} !=on | |
RewriteCond %{REQUEST_URI} !robots\.txt | |
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment