HTTP / HTTPS redirection


/ Published in: Apache
Save to your folder(s)



Copy this code and paste it in your HTML
  1. # redirecting all https traffic to http
  2. RewriteCond %{HTTPS} on
  3. RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [L]
  4.  
  5. # redirecting all http traffic to https
  6. RewriteCond %{HTTPS} off
  7. RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L]

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.