想要将所有具有特定 url 模式的页面重定向到我的新主页
使用以下模式重定向所有请求
http://somesite.com/pages/homepage/<Anything>
要重定向的示例网址
http://somesite.com/pages/homepage/?pn=1&cat=71
要重定向的新页面
http://somesite.com
您可以在根 .htaccess 中使用此规则作为您的第一条规则:
RewriteEngine On
RewriteRule ^pages/homepage(/.*)?$ /? [L,NC,R=301]