I have searched around but can’t find the answer to this relatively simple question;
how change the visible URL, AND send it to a certain file.
This is my .htaccess
RewriteEngine On
RewriteRule ^xyz/([A-Za-z0-9\ -]+)$ index.php?xyz=$1 [L]
Links are built like mydomain.com/xyz/uniquecode
Above Rewriterule triggers the file index.php?xyz=uniquecode
But I ALSO want it to change the visible URL to mydomain.com or maybe mydomain.com/someotherfolder
How do I do it?
I think I have to create some rewrite conditions but not sure how.
Thanks in advance.
……………………………………………………………………………………….
EDIT :
Just to clarify:
What I want is to give out personal links like
mydomain.com/affiliate/users-unique-code-here and when the link is clicked the url in the browser instead show
mydomain.com or
mydomain.com/somefolder
while it of course trigger my file index.php?affiliate=users-unique-code-here
It should be possible to do all this in the .htaccess
yes
start_session(); if (isset($_GET['xyz'])){$_SESSION['topost']=$_GET;header('location: mydomain.com');} if (isset($_SESSION['topost'])){$_GET=$_SESSION['topost'];unset($_SESSION['topost']);}if isset $_GET save it and set location, at the new location if exists saved data, set it to the $_GET and new visible address but $_GET is the same