Hello! need help ... When contacting www.domainname.com/novosti/i/single-news, I need to send a visitor to www.domainname.com/news/single-news and put 301 redirects. I do not understand why this is not working:
location /novosti/i { rewrite ^/novosti/i/(.*)/[^/]+$ /news/$1; } When using such a pattern, when you go to domainname.com/novosti/i/single-news, it simply transfers to the main page (
/novosti/i/single-newsdoes not fall under the regular expression^/novosti/i/(.*)/[^/]+$because after/novosti/i/there is not a single slash, what is required by a regular expression. - aleksandr barakin