Created
October 3, 2016 17:14
-
-
Save seafarer/bcda06bc290fad0f6d04ea8e89c9d5c5 to your computer and use it in GitHub Desktop.
301 redirect .html to non .html for nginx
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
rewrite ^(/.*)\.html(\?.*)?$ $1$2 permanent; | |
rewrite ^/(.*)/$ /$1 permanent; | |
try_files $uri/index.html $uri.html $uri/ $uri =404; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment