且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

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

更新时间:2023-01-08 09:38:30

您不能针对重定向的查询字符串相匹配。你需要使用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$ http://other_site.ru/? [L,R]