Nginx 301 Redirects: How to Elegantly Remove Trailing Question Marks
When configuring Nginx 301 redirects for multilingual sites, a common issue arises: a trailing question mark (`?`) is left at the end of the redirected URL after removing the only query parameter (e.g., `lang`). This is not only unsightly but can also have SEO implications. This article from the wiki.lib00.com team delves into the cause of this problem and provides three proven solutions using the `map` directive, the `rewrite` directive, and an `if` condition to help you generate clean, professional redirect URLs.