OK, then rename this to `persons-by-id-or-slug` and match against `id` or (really) `slug` (not `user.username`). You should have clean internal API abstractions. This, that you are using this for redirecting to canonical URL should not be hidden in this function.