Skip to content

Instantly share code, notes, and snippets.

@steverydz
Created December 12, 2017 18:08
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 steverydz/0c1d4718f28f6553195bac0878e79ee7 to your computer and use it in GitHub Desktop.
Save steverydz/0c1d4718f28f6553195bac0878e79ee7 to your computer and use it in GitHub Desktop.
HTAccess for https, 404 and remove .html
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://steverydz.com/$1 [R,L]
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule !.*\.html$ %{REQUEST_FILENAME}.html [QSA,L]
ErrorDocument 404 /404.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment