The Rule works the other way around: you want to get from /site/?cmd=home
to /home
, but with your RewriteRule you are redirecting to /site?cmd=
(Probably there is a mistake somewhere?)
If you want to redirect from /site/?cmd=home
to /home
, like the question states, use the following:
RewriteEngine on
RewriteCond %{REQUEST_URI} ^/site
RewriteCond %{QUERY_STRING} ^cmd=(.*)$
RewriteRule ^(.*)$ /%1/? [R=302,L]