I
I
Irina2018-07-02 10:23:18
Nginx
Irina, 2018-07-02 10:23:18

Redirect with a question mark - how to do it on nginx?

for a link like
/uslugi/?/litsom/
make a redirect to a simple section of the site - like /shop/catalog/
like
rewrite ^/uslugi/?/litsom/ /shop/catalog/ permanent;
but it does not work, I understand that because of the question mark. I tried to shield, replace, until it worked

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Skobkin, 2018-07-02
@skobkin

Most likely, it does not work because the question mark is a service character, after which the request parameters are passed. Maybe you shouldn't use it in the URI?
But if you still really want to, you can try to encode it in urlencode() and get %3F, which you can write in the config.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question