Mod rewrite Apache重写规则:如何删除参数

Mod rewrite Apache重写规则:如何删除参数,mod-rewrite,url-rewriting,Mod Rewrite,Url Rewriting,快速一步:创建一个url,如: /some.aspx?p=1&p=2 我需要重定向到: /other不带任何参数 我有以下资料: RewriteRule \/some\.aspx? /other? [NC,L,R=301] 但我还是以拖尾结束?i、 e./其他?用以下代码替换您的代码: RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s/+some\.aspx\?p=1&p=2[&\s] [NC] RewriteRule ^ /other? [R=3

快速一步:创建一个url,如: /some.aspx?p=1&p=2 我需要重定向到: /other不带任何参数

我有以下资料:

RewriteRule \/some\.aspx? /other? [NC,L,R=301]

但我还是以拖尾结束?i、 e./其他?

用以下代码替换您的代码:

RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s/+some\.aspx\?p=1&p=2[&\s] [NC]
RewriteRule ^ /other? [R=301,L]