Replace routes only when using prefixes

This is a minor optimization to not bother with replacing a tuple-based
route if neither a module prefix nor a path prefix has been specified.