Rewrite rules recoded (fixed a security issue)