S
S
sane102018-08-20 13:15:19
Nginx
sane10, 2018-08-20 13:15:19

How to make a redirect to nginx with a sign?

Good afternoon, how can I redirect to nginx, at the moment there are two urls with a question mark.
A redirect is needed for pages like
https://yzi4d.ru/shali/endokrinologiya-v-shali/?amp
to redirect to the page
https://yzi4d.ru/shali/endokrinologiya-v-shali/amp/
the presence of the sign confuses? because of which the standard method did not help

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dodo512, 2018-08-20
@sane10

if ($request_uri ~ "^([^?]+/)\?([a-z]+)$") {
    return 301 $1$2/;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question