If you really want to redirect requests of the form /controller/action?param1Name=param1Value
to /controller/action/param1Name/param1Value
, try this:
RewriteCond %{THE_REQUEST} ^GET /[^/]+/[^/]+?[^s]+
RewriteCond %{QUERY_STRING} ^([^=&]+)=([^&]+)&?(.*)
RewriteRule ^[^/]+/[^/]+.* /$0/%1/%2?%3 [N]
RewriteCond %{THE_REQUEST} ^GET /[^/]+/[^/]+?[^s]+
RewriteRule ^[^/]+/[^/]+.* /$0 [L,R=301]
But if you want to opposite way:
RewriteRule ^([^/]+/[^/]+)/([^/]+)/([^/]+)(/.*) $1$4?$2=$3 [QSA]
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…