将查询字符串重定向到根


Redirect query string to root

我已经尝试了许多重定向的变体,根据研究重写了条件和规则,虽然我知道我有很多东西要学习重定向,但我真的很难弄清楚如何将查询字符串重定向到我的根目录:/

我需要将 http://www.stapletondenver.com/news/press_detail.asp?pressReleaseID=10 重定向到 http://www.stapletondenver.com

同样,我尝试了一些变体,包括以下内容:

RewriteCond %{QUERY_STRING}  ^/news/press_detail.asp?pressReleaseID=10$
RewriteRule (.*)  /?  [R=301,L]

是否走在正确的轨道上和/或我做错了什么?非常感谢所有和任何帮助,提前感谢!

尝试:

RewriteCond %{QUERY_STRING}  ^pressReleaseID=10$
RewriteRule ^/?news/press_detail'.asp$  /?  [R=301,L]

%{QUERY_STRING}变量只是查询字符串,而不是 URI 的任何部分。