Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
目前,我们有 25 多个域转发到一个 www.mydomain.com。我需要使用 PHP 做的是根据引用域再次将流量转发到 www.mydomain.com/#.html。所以...
www.mydomain1.com -> www.mydomain.com -> www.mydomain.com/1
我已经能够使用 If/ElseIf/Else 语句为 2 完成此操作,但为了更进一步,我相信我需要使用 Switch/Case 例程,但我不确定最好的方法它。
$referrers = array( "domain.com" => "somepage.html", "domain2.com" => "somepage2.html" ); $referrer = //get domain coming from if( !empty( $referrers[$referrer] ) ) { // redirect to $referrers[$referrer]; }