# the ssl host [...]# ServerName etc. RewriteEngine on RewriteRule ^/cgi-bin/prog.pl(\?.*)$ http://my.server/cgi-bin/prog.pl$1