Rack middleware to transparently route requests with a subdomain to a specified path with substitutions