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) while simultaneously referring to an employee number who was responsible for the referral.
So, the referral links need to look like:
www.domain.com/referral/1555
Where 1555 is the employee ref number who sent this referral link, and it's the employee ref number 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