301 Redirect

I've registered a domain which was a main shop of affiliate program. This domain has backlinks with affiliate IDs like :
domain.com/item100.php?affid=0001&trkid=forum1
domain.com/item111.php?affid=0002&trkid=youtube
domain.com/item1010.php?affid=0101

So, how to make right 301 redirect if my website in HTML now and not php and how to redirect one affiliate's url with multiply tracking IDs to the page I need?
Thank you!