I presently use register.php?referal=gamestand on my small website to ensure that once the user visits this site with the referal website, I'm able to track the number of gamers have registered from that place.

referal=gamestand will instantly complete a port textfield inside the registration process using echo $_GET['code']

The issue is... on the internet I've lots of links from all of these referals and Let me 301 these to my register.php page to merge the Search engine optimization score into one and finally remove these silly register.php?code=gamestand style links from google.

I have got this rewrite rule... which removes the ?code=gamestand bit, however it does not really pass the parameter, most likely since it is redirecting and delivering nothing?

RewriteCond %{QUERY_STRING} ^(.*)code(.*)$
RewriteRule ^(.*)$ http://localhost/mywebsite/httpdocs/register.php? [R=301,L] 

it'll change register.php?code=gamestand into register.php but when i stated, $_GET['code'] has become empty and I am to where you started!

Appreciate any help if anybody knows anything... Thanks! Dom

You can keep referrer inside a session variable, then redirect to register.php with no code. Your URL will not retain the code anymore, but it is available through the session.

if (isset($_GET['code'])) {
  $_SESSION['code'] = $_GET['code'];
  header('Location: register.php');


echo $_SESSION['code'];

Redirecting these Web addresses towards the same Url most likely will not merge your Search engine optimization score into one. Your present technique is fine, don't wreck havoc on it.