I have a domain called example.com that takes a parameter ?ref=XXXXXX.
The referral URLs are ex.co/XXXXXX
My question is, when a user goes to ex.co/AhJ7z1 or any random string, how do I configure my server to forward to example.com/?ref=AhJ7z1.
Is that something that can be done in .htaccess or php.ini or something like PHP?
EDIT :
I’d like this to be done in a PHP script if possible so that I can reserve certain URLs and restrict URLs outside of what I want.
Is there an .htaccess script I could utilize index.php in root directory to do this?
In your .htaccess you can do something like this:
EDIT: to redirect to index.php
Then it’s a matter of you writing your index.php script to grab the ‘ref’ parameter and find what URL to redirect to.