handle legacy HM Rewrite