kevinquillen
3/31/2017 - 3:25 PM

Example htaccess rule to force all traffic over HTTPS

Example htaccess rule to force all traffic over HTTPS

  # Force all traffic to HTTPS, except a local instance
  RewriteCond %{HTTPS} off
  RewriteCond %{HTTP:X-Forwarded-Proto} !https
  RewriteCond %{HTTP_HOST} !^mysite\.local$ [NC]
  RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]