Skip to content

Instantly share code, notes, and snippets.

@craigw
Created February 1, 2010 16:51
Show Gist options
  • Save craigw/291813 to your computer and use it in GitHub Desktop.
Save craigw/291813 to your computer and use it in GitHub Desktop.
# Does the requested file not exist?
RewriteCond %{REQUEST_FILENAME} !-f
# AND is there a file that matches the requested file but with .html at the end?
RewriteCond %{REQUEST_FILENAME}.html -f
# Then rewrite the request under the hood and serve the HTML file.
RewriteRule ^([^.]+)$ $1.html [QSA]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment