Ability to use variables in replacement strings for rewrite middleware.

Can you add support for new variables here as well?