RewriteCond %{SERVER_PORT} !^443$ RewriteCond %{QUERY_STRING} (.+)=(.+) RewriteRule .* https://www.example.org/cgi-bin/script.pl?%1=%2