Difference between revisions of "Redirect http to https"

From vpsget wiki
Jump to: navigation, search
Line 6: Line 6:
  
  
[[Сategory:Linux]]
+
[[Category:Linux]]

Revision as of 10:50, 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}