I have uploaded this script provided to me by the marketplace I work with to redirect affiliate traffic based upon a parameter that designates which sales page (or the typical home page) the visitor gets sent to. The Script is based on a parameter that the affiliate chooses based upon the nature of the promotion they are doing.
However, this script results in one of two things. The first, it completely bypasses the script and all 3 parameters sends the traffic to the homepage. The second being an Internal HTTP 500 error. However, I do believe I fixed the 500 error code cause before shutting down the script so our traffic wouldn’t be affected during daytime hours. So my question is why would all 3 parameter IDs go to the home page? Is there something I’m forgetting to put in the script? Server runs PHP7. Below is the script (url3 is set as the home page, I had to remove the url due to forum restriction and me being a new user)…
<?php
$url1="http://www.cleanuptheprofits.com/officecleaningkit";
$url2="http://www.cleanuptheprofits.com/housecleaningkit";
$url3="HomePageURL";
if ($_GET['pid'] == "1")
{
header("Location: $url1".preserve_qs());
}
elseif ($_GET['pid'] == "2")
{
header("Location: $url2".preserve_qs());
}
elseif ($_GET['pid'] == "3")
{
header("Location: $url3".preserve_qs());
}
else
{
header("Location: $url3".preserve_qs());
}
?>