handle statics and rewrites; remove md5 optimisation