Nginx rewrite all html files except index

view full story

http://serverfault.com – I'm having a bit of trouble with Nginx rewrites. I recently moved by blog over to a new engine, and the URL structure has changed. On my old blogging engine posts were located at a URL with the form http://$host/yyyy/mm/title.html however on the new engine they have the form http://$host/yyyy/mm/title/. The actual file that is being returned by the server resides at /yyyy/mm/title/index.html. To make sure links in old posts still work I want to do a rewrite in Nginx that looks something like this: rewrite ^/(\d\d\d\d)/(\d\d)/(.+)\.html$ $scheme://$host/$1/$2/$3/ permanent; Unfortunately, t (HowTos)