The upgrade doc is always a good place to start, see this section: http://ez.no/doc/ez_publish/upgrading/upgrading_to_4_0/from_4_0_x_to_4_0_y#eztoc98307_4_1
Edit: Sorry, just assumed you had upgraded from 4.0.0 or 3.10.0. If you haven't, where did you get the rewrite rules from?