RewriteEngine On
RewriteRule ^/path/to/program/param1/([^/]*)/param2/([^/]*)$ http://example.com/path/to/program?param1=$1&param2=$2&%{QUERY_STRING} [P,L]