Site icon Hip-Hop Website Design and Development

Pulling a parameter out of the URL of a WP link without "?" or being sent to a different page

I have a specific requirement that my referral link be as simple as possible to type in manually (customer base is very low skilled).

So, the referral links need to look like:

www.domain.com/referral/1555

Where "1555" is the referral link that I’ll be taking out of the URL.
I’m using PHP snippets to deal with loading that data and handling it, but I need to land on the "referral" page inorder for that php snippet to fire.

How do I dictate to WP that any URL slug starting with "referral", regarldes of what comes after, goes to my referral page and keeps the URL intact? The best I can do right now is land on the referral page but the URL gets reset to merely

www.domain.com/referral