Preprocess routes and read search string when in pathname mode