Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
apache:redirect-http-to-https [2014-08-05 18:11:26] shaun.reitanapache:redirect-http-to-https [2019-05-02 16:43:03] (current) shaun.reitan
Line 3: Line 3:
 The below code when added to an .htaccess file will automatically redirect any traffic destined for http:// to https:// The below code when added to an .htaccess file will automatically redirect any traffic destined for http:// to https://
  
-<code>RewriteEngine On +<code> 
-RewriteCond %{HTTPS} off +<IfModule mod_rewrite.c> 
-RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]+    RewriteEngine On 
 +    RewriteCond %{HTTPS} off 
 +    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L] 
 +</IfModule>
 </code> </code>
  
 {{tag>how-to apache}} {{tag>how-to apache}}