将旧的重写规则重定向到新的规则
我的 .htaccess 文件中有这条规则,
RewriteRule ^business/(.*)/(.*)/(.*)$ ./businesspage.php?name=$1&place=$2&id=$3
为了 SEO 目的,我想将其缩短,因此只有两个参数,$3
& $1
。
但是,我希望在 google 上索引的旧网址重定向到新网址。我该怎么做?
例如 /business/name/place/id
-> /id/name
。
谢谢
I have this rule on my .htaccess file
RewriteRule ^business/(.*)/(.*)/(.*)$ ./businesspage.php?name=$1&place=$2&id=$3
I want to make it shorter for SEO purposes, so there would be only two parameters, $3
& $1
.
However, I want the old URLs indexed on google to redirect to the new ones. How do I do it?
For example /business/name/place/id
-> /id/name
.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您现有的规则上面类似的内容应该适用于重定向:
然后我假设您还想修改现有的规则,如下所示:
Something like this above your existing rule should work for the redirection:
Then I assume you also want to modify your existing rule like this: