You could add something like this in your htaccess:
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^redirect\.html$ /%1 [L,R=301]
EDIT: based on comments, you’ll need some additional conditionals to sort different query strings.
RewriteCond %{REQUEST_URI} ^/redirect.html(.*)$
RewriteCond %{QUERY_STRING} ^p=test$
RewriteRule (.*) /new-test/ [L,R=301]
RewriteCond %{REQUEST_URI} ^/redirect.html(.*)$
RewriteCond %{QUERY_STRING} ^p=pagename$
RewriteRule (.*) /new-page/ [L,R=301]
I also highly recommend this site for testing htaccess: http://htaccess.madewithlove.be/