Added redirect middleware.