【发布时间】:2021-04-19 12:48:02
【问题描述】:
我正在尝试重定向 301 页面。我遇到了一个问题,我陷入了困境。 第1页:https://test.example.com/the-magazine/2012-springsummer-issue/about-last-night-event-planning/
对于上面的页面,我将重定向正则表达式写为:
Source URL: /the-magazine/2012-springsummer-issue/([A-Za-z].*)
Target URL: https://www.example.com/article/$1
$1 替换 (.*) 捕获的所有文本
我还有一个页面:
2nd Page: https://test.example.com/category/the-magazine/2012-springsummer-issue
此页面也正在重定向。 如何编写一个正则表达式来说明“/category/”是否存在不要重定向到目标 URL:https://www.example.com/article/$1
提前谢谢你
【问题讨论】:
-
这能回答你的问题吗? Reference - What does this regex mean?
标签: regex wordpress url redirect