How can I keep the PURL with just firstname.lastname?

To keep a PURL from redirecting to a longer URL there's some steps you'll have to take to prevent that from happening.

Warning: by making the changes below, you'll only be able to have one campaign per domain name. If you'll need additional pages (2,3 etc) to also keep the same first and last name format additional custom coding would need to done.

Preventing PURL redirect

On the top of the index.php file (on your server) you'll see the PURL CODE. Remove the part commented by Begin Campaign Redirect.


//******* PURL CODE - DO NOT EDIT ************

$data = @file_get_contents(''.$_GET["ID"].'&name='.$_GET["name"].'&page='.$_GET["page"].'&test='.$_GET["test"].''); if(empty($data)) { echo 'PURL Not Found'; exit; } $user = json_decode($data);** /*Begin Campaign Redirect*/if($user->{'purlpage'} && (stristr($_SERVER['REQUEST_URI'], $user->{'purlpage'})) === FALSE) { header('Location: '.$user->{'url'}.'/'.$user->{'purlpage'}.'?ID='.$_GET["ID"].'&name='.$_GET["name"].'&page='.$_GET["page"].'&test='.$_GET["test"]); } /*End Campaign Redirect*/** @session_start(); if($_GET['username']) $_SESSION['visitor']=$_GET['username']; if($user->{'login'} && ($_SESSION['visitor'] != $user->{'firstName'}.''.$user->{'lastName'})) { echo $user->{'login'}; exit; }

//******* END PURL CODE ************


Now you'll have to make a modification to the .htaccess file (also on your server). Find the Line that begins with RewriteRule.


RewriteEngine on

RewriteCond %{SCRIPT_FILENAME} !([A-Za-z0-9_]+).(html?|php|asp|css|jpg|gif|shtml|htm|xhtm)/?$ [NC]

RewriteCond %{REQUEST_FILENAME} !-d

RewriteCond %{REQUEST_FILENAME} !-f

*RewriteRule ^([A-Za-z0-9]+).([A-Za-z0-9]+)/?$$1$2&ID=261&page=1 [R,L]


On that line do the following:

  1. Delete:
    RewriteRule ^([A-Za-z0-9]+).([A-Za-z0-9]+)/?$$1$2&ID=261&page=1 [R,L] ** 
  2. Delete: [R,L] from the end of the line: 
    RewriteRule ^([A-Za-z0-9]+).([A-Za-z0-9]+)/?$ purlpage_campaign?name=$1$2&ID=261&page=1 [R,L]
  3. Make sure /index.php appears just before ?name=$1$2 
    RewriteRule ^([A-Za-z0-9]+).([A-Za-z0-9]+)/?$ purlpage_campaign* /index.php*?name=$1$2&ID=261&page=1

When all is uploaded to your server, the PURL should remain just the first and last name.