Created
June 29, 2018 09:19
-
-
Save artikus11/11ad872a5081c80f497b0fc4db2f2453 to your computer and use it in GitHub Desktop.
Редирект с http На 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
#Вариант 1 | |
RewriteCond %{HTTP:X-HTTPS} !1 | |
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L] | |
#Вариант 2 | |
RewriteEngine On | |
RewriteCond %{HTTPS} off | |
RewriteCond %{HTTP:X-Forwarded-Proto} !https | |
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] | |
#Вариант 3 | |
RewriteCond %{SERVER_PORT} !^443$ | |
RewriteRule ^/(.*) http://%{HTTP_HOST}:443/$1 [L,R] | |
#Now, rewrite to HTTPS: | |
RewriteCond %{HTTPS} off | |
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://s319654.smrtp.ru/