When they go through your front line, just move your front line back, and your archers in front of it (so they're in the middle, and their inf. are attacking your shields.) They'll attack the closest unit, and you can put your archers vs. theirs, and then turn them on their infantry.