【发布时间】:2015-06-04 07:10:38
【问题描述】:
如何将具有相同子字符串的 URL 重定向到新页面
我必须重定向大约 200 个这种类型的 URL:
Redirect 301 /folder/page1.html http://domain.com/new-a
Redirect 301 /folder/xyz_page1.html http://domain.com/new-a
Redirect 301 /folder/page2.html http://domain.com/new-b
Redirect 301 /folder/xyz_page2.html http://domain.com/new-b
除了字符串“xyz_”之外,“page1.html”/“xyz_page1.html”“page2.html”/“xyz_page2.html”相似
如果我可以为字符串“xyz_”使用某种通配符来编写重定向,例如
Redirect 301 /folder/*page1.html http://domain.com/new-a
Redirect 301 /folder/*page2.html http://domain.com/new-b
我只需要重定向其中的一半,而不是 200 个 URL。
有什么建议吗?谢谢。
【问题讨论】:
标签: apache .htaccess redirect drupal url-redirection