且构网

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

如何重定向基于查询字符串的URL?

更新时间:2023-02-26 12:09:08

既不重定向也不RedirectMatch允许您指定为重定向源的查询字符串。的 [来源]

neither Redirect nor RedirectMatch allow you to specify a query string for the redirect source. [Source]

您必须使用国防部重写基于查询字符串重定向:

You have to use mod-rewrite for redirecting based on query string:

RewriteCond %{QUERY_STRING}  ^p=375$
RewriteRule (.*)  http://www.example.org/content/MyNewPage?  [R=301,L]