从具有参数的URL重定向到另一个网站

编程入门 行业动态 更新时间:2024-10-17 14:20:10
本文介绍了从具有参数的URL重定向到另一个网站的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 redirect /index.php?categoryID=647 other_site.ru/

这是precisely这一类店的引用到另一个站点。在这种形式下,不能正常工作。我怀疑,这个问题是由于一个参数。如何做正确的事? 对不起,我的英文不好(谷歌翻译)

That is precisely this category store a reference to another site. In this form, does not work. I suspect that the problem is due to an argument. How to do the right thing? Sorry for bad english (google translator)

推荐答案

您不能针对重定向的查询字符串相匹配。你需要使用mod_rewrite和比赛反对%{QUERY_STRING} 变量:

You can't match against the query string in a redirect. You need to use mod_rewrite and match against the %{QUERY_STRING} variable:

RewriteEngine On RewriteCond %{QUERY_STRING} ^categoryID=647$ RewriteRule ^index\.php$ other_site.ru/? [L,R]

更多推荐

从具有参数的URL重定向到另一个网站

本文发布于:2023-11-01 01:51:44,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1547899.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:重定向   参数   网站   URL

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!