Ability to use variables in replacement strings for rewrite middleware.

You can translate the old syntax for the new one for backwards compatibility