raouting to right urls with both modes without errors