Rack middleware replacement for mod_rewrite