Skip to content

Instantly share code, notes, and snippets.

@j26design
Created April 11, 2016 19:57
Show Gist options
  • Save j26design/e50087b947a4148477e4e4328da351c3 to your computer and use it in GitHub Desktop.
Save j26design/e50087b947a4148477e4e4328da351c3 to your computer and use it in GitHub Desktop.
Force .html extension with .htaccess
# This code must be placed in the .htaccess
# file that is located in the root directory
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^.]+?)/?$ /$1.html [L,R=301]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment