Fixed routing function for uri prefixes