The following code works for me to hide the Extensions in the Middle of the URL, but it's redirecting twice: rewrite ^(.+)\.html(/.*)?$ $1$2 permanent; rewrite ^/(.*)/$ /$1 permanent; try_files $uri/index.html $uri.html $uri/ $uri =404; First, it redirects the end .html Second, it redirects the middle .html I require it to be in a single span. Any !dea?by eligiable - How to...
The following code got me what I was looking for, but it doesn't remove the .html extension inside the URL, it only removes the ending extension: rewrite ^(/.*)\.html(\?.*)?$ $1$2 permanent; rewrite ^/(.*)/$ /$1 permanent; try_files $uri/index.html $uri.html $uri/ $uri =404; Any Help Please ... ?by eligiable - How to...
I'm new to Nginx, I need to remove all the *.html extensions appear in my URL, e.g. http://mywebsite.com/events.html/beauty-must-haves.html I've tried lots of solutions to fix this, but not able to fix, can anyone kindly help me to fix this. These are no hard coded pages, it generates at runtime the following link doesn't help fix it. how to serve html files in nginx without showing the exteby eligiable - How to...