Add redirect middleware