Change to use request.path rather than request.env['REQUEST_URI'] because the former seems to work better