nginx seems to treat %3F as "?"

ST smntov at gmail.com
Wed Nov 22 15:34:13 UTC 2017


Hello,

I have following redirection rule defined:

location ~ "^/(.*)\.html[^\?]+" {
          return 301 /$1.html;
}

so that everything besides "?" after an URL gets truncated:
like
 example.com/test.html%D1%80%D0%BE%D1%80%D0%BB -> example.com/test.html

however it doesn't work when "?" is url encoded into %3F. I would like
example.com/test.html%3F to redirect to example.com/test.html

Is it possible somehow?

Thank you!



More information about the nginx mailing list