Reputation: 109
I'm trying to turn this:
/index.php?param1=1¶m2=1¶m3=1
into this:
/index.php?param1=1¶m3=1
I would have thought this would work:
RewriteCond %{QUERY_STRING} param2 [NC]
RewriteRule ^index.php?(.*)param2=([0-9]+)(.*)$ index\.php\?$1&$3 [R=301,QSA,L]
...but it and other variations are doing sod all :(
any ideas?
Upvotes: 2
Views: 570
Reputation: 7739
Try this :
RewriteCond %{QUERY_STRING} ^(.*&)?param2=([^&]+)&?(.*)?$
RewriteRule ^index\.php$ index.php?%1%3 [L,R=301]
Upvotes: 3