nginx - How to remove all .html from the URL | Nignx -
i'm new nginx, need remove *.html extensions appear in url, e.g. http://mywebsite.com/events.html/beauty-must-haves.html
i've tried lots of solutions fix this, not able fix, can kindly me fix this. these no hard coded pages, generates @ runtime following link doesn't fix it.
how serve html files in nginx without showing extension in alias setup
i need seo friendly e.g. http://mywebsite.com/events/beauty-must-haves
thanx in advance.
the following code got me looking for, doesn't remove .html extension inside url, removes ending extension:
rewrite ^(/.*)\.html(\?.*)?$ $1$2 permanent; rewrite ^/(.*)/$ /$1 permanent; try_files $uri/index.html $uri.html $uri/ $uri =404;
any please ... ?
Comments
Post a Comment