Skip to content

Instantly share code, notes, and snippets.

@joemaller
Created March 14, 2019 20:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joemaller/0d7b513f3abea0f8dcd9938963be9cb8 to your computer and use it in GitHub Desktop.
Save joemaller/0d7b513f3abea0f8dcd9938963be9cb8 to your computer and use it in GitHub Desktop.
A very simple htaccess file for redirecting traffic from http to https (insecure to secure)
RewriteEngine On
RewriteCond %{ENV:HTTPS} !on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
ErrorDocument 404 /404.html
ErrorDocument 401 "Unauthorized Access"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment