【发布时间】:2019-06-04 14:22:40
【问题描述】:
所以我有点麻烦。
我有许多产品的 URL 部分与我最近更改的相同:
https://www.website.com/shop/category-sample/product1/
https://www.website.com/shop/category-sample/product2/
https://www.website.com/shop/category-sample/product3/
https://www.website.com/shop/category-sample/product4/
我需要“category-sample”为“category”
所以新的 URL 应该是这样的:
https://www.website.com/shop/category/product1/
等等
谢谢!
【问题讨论】:
-
什么网络服务器?你有 mod_rewrite 吗?
-
对不起,我应该更清楚。我正在通过 Kinsta 托管 wordpress,因此它在 Nginx 上提供服务。我确实安装了 Yoast,但是我不确定如何使用他们的正则表达式重定向来设置它。
标签: regex redirect url-rewriting url-redirection