Find and replace in a URL?

Is it possible to use find and replace in some way to replace the unique ID of a URL with a different number?

I know I can reference a slug directly in the URL, but I have other workflows on the page that make it to where I need to call a thing’s unique ID, but I want the user to see a different ID in the URL.

Whats the objective you’re trying to achieve by hiding the ID?

I have user profiles and user jobs that other users can reference with a shortened ID, each with 5 digits. I don’t want to confuse users by showing two IDs for the same record.

I would suggest using those as url parameters then?

Slugs? They can be used instead of unique IDs in virtually all cases

Most users won’t understand enough to look at URLs and typically your param names shouldn’t be so obvious that it tells the user exactly what the param means. I highly doubt you’ll confuse them with URL Params.

2 Likes