[RewriteRules] 2 fixes

The commit d03b894f903e608272256c9b477cfc12167d3cba is present in the commit 2ce4b643948fb9c1e507c4d99f6bdb47f213adf8. I keep it for the commit message; if someone look for the fixes the modification is clear.