Ability to use variables in replacement strings for rewrite middleware.

Do we need t export this?