1: Fix empty uri redirect bug
2: Add multi env support