Updates for the rewrite middleware

- Fixed middleware instantiation process.
- Use `RawURL()` instead of `URL.String()` method.
Can you use strings.Join instead?