Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
apache:redirect-http-to-https [2011-04-25 15:56:46]
shaun.reitan Approved
apache:redirect-http-to-https [2019-05-02 23:43:03]
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 console+<code> 
-RewriteEngine On +<IfModule mod_rewrite.c> 
-RewriteCond %{HTTPS} off +    RewriteEngine On 
-RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]+    RewriteCond %{HTTPS} off 
 +    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L] 
 +</IfModule>
 </code> </code>
  
 {{tag>how-to apache}} {{tag>how-to apache}}