fixed redirects when request.uri is not equal to request.env['REQUEST_URI']