Главная > Web > .htaccess redirect to https

.htaccess redirect to https

RewriteEngine On
RewriteCond %{HTTPS} off
#RewriteCond %{REQUEST_URI} !/robots\.txt
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

или другой вариант (Sweb)

RewriteEngine On
RewriteCond %{HTTP:HTTPS} !=on [NC]
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
SetEnvIf X-Forwarded-Proto https HTTPS=on

nic.ru

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteCond %{HTTP:X-Forwarded-Proto} !https
#RewriteCond %{REQUEST_URI} !/robots\.txt
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Categories: Web Tags:
  1. Пока что нет комментариев.
Похожие публикации