jtrupiano / rack-rewrite

A web server agnostic rack middleware for defining and applying rewrite rules. In many cases you can get away with Rack::Rewrite instead of writing Apache mod_rewrite rules.
http://github.com/jtrupiano/rack-rewrite
MIT License
836 stars 80 forks source link

Remove host from PATH_INFO #77

Closed pomartel closed 6 years ago

pomartel commented 8 years ago

When a rewrite rule changes the host, the PATH_INFO should not include the host.

I am not so sure if my regexp catches all the possible scenarios.

pomartel commented 8 years ago

I am not well versed with regexp but you can play with the one I came up with here to see if it catches all scenarios: http://rubular.com/r/G0jnQnoosG