.htaccess 301 重定向与查询
我知道有很多这样的问题,但我仍然不明白我的问题。感谢在 Google 上发现的各种链接,我们发现该网站有一个错误链接。我为其编写了一个重写条件,如下所示:
RewriteCond %{QUERY_STRING} ^t=&s=BARREEL+YOUR+OWN+BOURBON+RISKY+WHISKY+BARREL+PACK+$
RewriteRule ^/results.php$ http://www.thepartysource.com/express/item.php?id=28952 [R=301]
“+”位于实际链接中。我尝试按如下方式编写它,以便它不会将它们视为特殊字符:
RewriteCond %{QUERY_STRING} ^t=&s=BARREEL\+YOUR\+OWN\+BOURBON\+RISKY\+WHISKY\+BARREL\+PACK\+$
RewriteRule ^/results.php$ http://www.thepartysource.com/express/item.php?id=28952 [R=301]
该网站仍然将我带到错误的页面并且不会重定向我。有人可以帮忙吗?提前致谢。
编辑:
网址是
/results.php?t=&s=BARREEL+YOUR+OWN+BOURBON+RISKY+WHISKY+BARREL+PACK+
I know there are tons of these questions out there, but I still don't understand my issue. Thanks to a miscellaneous link found on Google, we've found a bad link for this website. I wrote a rewrite condition for it that is the below:
RewriteCond %{QUERY_STRING} ^t=&s=BARREEL+YOUR+OWN+BOURBON+RISKY+WHISKY+BARREL+PACK+$
RewriteRule ^/results.php$ http://www.thepartysource.com/express/item.php?id=28952 [R=301]
The '+' are in the actual link. I've tried writing it as follows so that it doesn't count them as special characters:
RewriteCond %{QUERY_STRING} ^t=&s=BARREEL\+YOUR\+OWN\+BOURBON\+RISKY\+WHISKY\+BARREL\+PACK\+$
RewriteRule ^/results.php$ http://www.thepartysource.com/express/item.php?id=28952 [R=301]
The site still takes me to the wrong page and does not redirect me. Can someone help with this please? Thanks in advance.
EDIT:
The URL is
/results.php?t=&s=BARREEL+YOUR+OWN+BOURBON+RISKY+WHISKY+BARREL+PACK+
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用
Redirect
,而不是退出RewriteRule
。但是,值得注意的是,Google 已表示您应该在您的网站上禁止/无索引搜索结果页面。
Rather than getting out
RewriteRule
s you can useRedirect
insteadHowever, it's worth noting, that Google has said you should Disallow/no-index search result pages on your site.