Awesome q2a theme

How to make Nginx redirect virus?

0 like 0 dislike
58 views
How to make Nginx redirect with site.com/%40user on site.com/@user

Write the following condition rewrite ^/%40(.*)$ /@$1 permanent;but no redirect. I think it's because of the sign %, it is necessary as-that to escape, because when I remove it and leave just 40 rewrite ^/40(.*)$ /@$1 permanent;, redirect works for site.com/40user

Tried to search for how to escape the %, but anything sensible there. Maybe not in that side dig?
by | 58 views

2 Answers

0 like 0 dislike
location and rewrite to match the request URI used in a normalized manner, i.e., after decoding the text specified in the form %XX.
In its original form, the query can be found in the $request_uri. There it is in full (with the arguments).

if ($request_uri ~ "^/%40(.*)$") { return 301 /@$1; }
by
0 like 0 dislike
Dig in the direction of Urlencode, IMHO.
by

Related questions

0 like 0 dislike
2 answers
0 like 0 dislike
2 answers
0 like 0 dislike
1 answer
asked Apr 9, 2019 by NeTLeaDeR
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
110,608 questions
257,187 answers
0 comments
40,796 users