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

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -