URL 重定向的 Nginx 规则

Nginx Rule for URL redirect

我一直在为下面写一个简单的 nginx rewrite/redirect 规则。

例如:https://example.com/news/abcxyz-pqr

的任何请求

应重定向至

https://example.com/news-and-articles/abcxyz-pqr

谢谢!

以下规则非常适合我。

rewrite ^/news/(.*)$ /news-and-articles/ permanent;