2012-09-21 97 views
2

我试图把这个:的.htaccess - 滴/编辑/删除查询字符串参数/标志

/index.php?param1=1 &参数2 = 1个&参数3 = 1

成这样:

/index.php?param1=1 &参数3 = 1

我还以为这会工作:

RewriteCond %{QUERY_STRING} param2 [NC] 
RewriteRule ^index.php?(.*)param2=([0-9]+)(.*)$ index\.php\?$1&$3 [R=301,QSA,L] 

...但它和其他的变化都在做SOD所有:(

什么想法?

回答

3

试试这个:

RewriteCond %{QUERY_STRING} ^(.*&)?param2=([^&]+)&?(.*)?$ 
RewriteRule ^index\.php$ index.php?%1%3 [L,R=301] 
+0

完美,非常感谢! – nedge2k

+0

欢迎你:)很高兴它的工作 – Oussama