Unsure why this isn't working.
URL: https://example.com/blog/2009/07/23/example
redirect to: https://example.com/example
rewrite "^/blog/([0-9]{4})/([0-9]{2})/([0-9]{2})/(.*)" /$5 permanent;
Server Fault is a question and answer site for system and network administrators. It only takes a minute to sign up.
Sign up to join this communityFigured it out :)
location /blog {
rewrite "/([0-9]{4})/([0-9]{2})/([0-9]{2})/(.*)" /$4 permanent;
}
rewrite "^/([0-9]{4})/([0-9]{2})/(.*)" /$3/ permanent;
Works just fine on a URL with just example.com/2000/02/03/example in it – JCats Jan 5 '19 at 3:01