.htaccess 301 重定向与查询

发布于 2024-12-12 07:06:04 字数 751 浏览 0 评论 0原文

我知道有很多这样的问题,但我仍然不明白我的问题。感谢在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

白况 2024-12-19 07:06:05

您可以使用Redirect,而不是退出RewriteRule

Redirect 301 /results.php?t=&s=BARREEL+YOUR+OWN+BOURBON+RISKY+WHISKY+BARREL+PACK+ http://www.thepartysource.com/express/item.php?id=28952 [R=301]

但是,值得注意的是,Google 已表示您应该在您的网站上禁止/无索引搜索结果页面。

Rather than getting out RewriteRules you can use Redirect instead

Redirect 301 /results.php?t=&s=BARREEL+YOUR+OWN+BOURBON+RISKY+WHISKY+BARREL+PACK+ http://www.thepartysource.com/express/item.php?id=28952 [R=301]

However, it's worth noting, that Google has said you should Disallow/no-index search result pages on your site.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文