How to know what is exactly the "@" sign or "%40" comes up in the URL?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
7 views
At first glance, the question is simple.. How to determine exact URL in PHP, which is displayed in the browser?

Illustrative example.

There is a link of this kind http://site.com/@userthat leads to the page user

On the server following code, which just displays the current URL

print_r("http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]");

The result is obvious http://site.com/@user

But if I replace the sign "@" with "%40" in the link (which is the same sign) then the result is the same.

Link: http://site.com/%40user
The result: http://site.com/@user

The goal is to understand if the URL of the form http://site.com/%40userthen make a redirect to http://site.com/@user

Maybe check/redirect should be put earlier on the side of nginx/apache?
by | 7 views

2 Answers

0 like 0 dislike
by
0 like 0 dislike
RewriteRule ^%40(.*) /@$1 [QSA,L]
by

Related questions

0 like 0 dislike
1 answer
asked Apr 9, 2019 by sys_user
0 like 0 dislike
7 answers
0 like 0 dislike
2 answers
asked Apr 12, 2019 by BenderLib
110,608 questions
257,186 answers
0 comments
35,533 users