Replaced split with regex to catch routes without / before query