init route redirect and forward function