Answer the question
In order to leave comments, you need to log in
How to implement negate redirect in nginx?
There is a set of URLs with the following content:
/category/*.html
/category/*/XXX.html , where * is a certain alphabetic sequence, and XXX is a number from 1 to 9999
Please tell me how to correctly write a rewrite rule in nginx so that all URLs of the form /category/*.html except for URLs like /category/*/XXX.html were redirected to URLs /category/*/
Answer the question
In order to leave comments, you need to log in
:D
here is the script
colbacolorbar.ru/themes/colba/assets/js/fluidWave.js I
don’t understand at all what’s going on there, like javascript, but some kind of complicated webGL framework, probably
UPD, I found this on github, xs maybe this original code
https://gist.github.com/peretc001/1444c3df210cc66c...
For example like this:
location /category/ {
# если URI заканчивается на XXX.html,
# то реврайтим в то же самое и прекращаем обработку.
rewrite "^(.+\d{1,4}\.html)$" $1 break;
# у всего остального заменяем `.html` на `/`
rewrite "^(.+)\.html$" $1/;
}
all URLs like /category/*.html except URLs like /category/*/XXX.html
in a letter sequence, in addition to letters, slashes, dashes and numbers can occur
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question