2016-12-13 6 views
1

リンク:WHMCS - カスタムアフィリエイトは、私がアフィリエイトシステム(<a href="http://www.whmcs.com/" rel="nofollow noreferrer">whmcs</a>)に入社し、私はアフィリエイトURLを受信

https://www.example.com/client/aff.php?aff=xxx 

事は、このリンクは、会社のホームページに私をリダイレクトしますが、私はこれを望んでいないということです。カスタムページにリダイレクトしたいこれは何らかの形で可能ですか?私はあなたがaff.phpファイル内のいくつかの手仕事を行うと、このようなURLを使用することができることを推測する最初のビューで

https://www.example.com/client/aff.php?aff=xxx&url=https://www.example.com/othersection 

答えて

1

数時間後、私はこのための解決策を見つけることができました。ただ前にファイルの下部に、aff.php内部WHMCS 7.0.2の最新のバージョンを使用して:

// 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

私は相対URLのためにこのコードを追加しました:

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(); 
} 

または絶対URLのために、このコード:

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

このコードは、バージョン6.2.2のために利用可能であると思われる - 6.3.1 - 7.0.2 - 7.1.0