Htaccess 301 redirect from url with query strings

I am renewing a website and trying to maintain SEO, so i need 301 redirects.
Problem is, old urls got query string.
What rewrite cond should use in htaccess? The new site is running on wordpress so the deafult index.php rule is already in the htaccess.

old url: http://domain.hu/index.php?m=2&am1=1&am2=0&n=ADOTANACSADAS
new url: http://www.domain.hu/newsite/szolgaltatasok/adotanacsadas/

Read More

old url: http://domain.hu/index.php?m=4&am1=0&am2=0&n=HIRLEVEL
new url: http://www.domain.hu/hirek/
The rule should work even if someone types the old url with www

Related posts