Difference between revisions of "Redirect http to https"
m (Protected "Redirect http to https" ([edit=sysop] (indefinite) [move=sysop] (indefinite))) |
|||
Line 4: | Line 4: | ||
RewriteCond %{HTTPS} !on | RewriteCond %{HTTPS} !on | ||
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} | RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} | ||
+ | |||
+ | |||
+ | [[Сategory:Linux]] |
Revision as of 10:49, 29 September 2017
In order to redirect http to https in Apache it's enough to add these lines to .htaccess file in the web root:
RewriteEngine On RewriteCond %{HTTPS} !on RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}