add middleware that rewrites "request.url"