try middleware redirect