I joined an affiliate system (whmcs) and I received a affiliate url:
https://www.example.com/client/aff.php?aff=xxx
The thing is that this link redirects me to the company homepage but I don't want this. I want to redirect to custom pages. Is this possible in some way?
At a first view I guess that you can do some handwork in the aff.php file and use the url like this:
https://www.example.com/client/aff.php?aff=xxx&url=https://www.example.com/othersection
After several hours, I managed to find a solution for this. Using the lastest version of whmcs 7.0.2 inside aff.php, at the bottom of the file just before:
// perform redirect
header("HTTP/1.1 301 Moved Permanently");
header("Location: ".$whmcs->get_config('Domain'),true,301);
https://www.example.com/client/aff.php?aff=xxx&url=othersection
I've added this code for relative url's:
if ($whmcs->get_req_var('url')) {
header("HTTP/1.1 301 Moved Permanently");
header("Location: ".$whmcs->get_config('Domain')."/".$whmcs->get_req_var('url'),true,301);
die();
}
or this code for absolute url's:
if ($whmcs->get_req_var('url')) {
header("HTTP/1.1 301 Moved Permanently");
header("Location: ".$whmcs->get_req_var('url'),true,301);
die();
}
https://www.example.com/client/aff.php?aff=xxx&url=https://www.example.com/othersection
It seems that this code is available for version 6.2.2 - 6.3.1 - 7.0.2 - 7.1.0