0
rewrite ^/faq/(.*)$ /faq/$1 redirect;

I would like to redirect domain.tld/faq/* to domain.tld/faq/

Unfortunately, this leads to an endless loop.

Background: There was the FAQ url and very many other URLs in the FAQ directory. These no longer exist, but only the FAQ main page.

1

1 Answer 1

0

Just don't use the capture group $1 and make sure there's something after the faq by adjusting regex to use +:

rewrite ^/faq/(.+)$ /faq/ redirect;

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .