Please enable / Bitte aktiviere JavaScript!
Veuillez activer / Por favor activa el Javascript![ ? ]
How to make a Rewrite with nginx? - Q&A

How to make a Rewrite with nginx?

0 like 0 dislike
Hello, there is a rewrite:

rewrite ^/(.+?)/(.+?)$ /cp.php?name=$1&nick=$2 last;
It comes to the name and nickname of the user. But it so happened that nick can begin with a dot.
URL: nginx gives a 403 Forbidden error.
URL: open.

Is it possible to change rewrite, forcing nginx to open links to begin with . ?
asked by | 70 views

2 Answers

0 like 0 dislike
The problem was in the last rule /\\. removed it and it worked.
answered by
0 like 0 dislike
Dot is a special character in regular expressions if you need to use the point as a point that required "seascaping" tochku \\.

Something like that
rewrite ^/(.+?)/(\\..+?)$ /cp.php?name=$1&nick=$2 last;
answered by
Welcome to Bug-code Q&A, where you can ask questions and receive answers from other members of the community.

24.8k questions

46.2k answers


12.3k users

24,788 questions
46,220 answers
12,337 users