Created
October 16, 2015 23:08
-
-
Save lackneets/c1f9fd3e92286933fc0a to your computer and use it in GitHub Desktop.
Hide html extension .htaccess
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RewriteEngine On | |
# To externally redirect /dir/foo.html to /dir/foo | |
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s([^.]+)\.html [NC] | |
RewriteRule ^ %1 [R,L,NC] | |
## To internally redirect /dir/foo to /dir/foo.html | |
RewriteCond %{REQUEST_FILENAME}.html -f [NC] | |
RewriteRule ^ %{REQUEST_URI}.html [L] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment