php多域名隨機跳轉 thinkphp如何根據(jù)域名跳轉到其他目錄頁面?
thinkphp如何根據(jù)域名跳轉到其他目錄頁面?ThinkPHP重定向方法可以實現(xiàn)頁面重定向(跳轉)功能。重定向方法的語法如下:$this->redirect(string URL,array p
thinkphp如何根據(jù)域名跳轉到其他目錄頁面?
ThinkPHP重定向方法可以實現(xiàn)頁面重定向(跳轉)功能。
重定向方法的語法如下:
$this->redirect(string URL,array params,int delay,string MSG)
參數(shù)說明:
Parameter
Description
URL
必須是重定向的URL表達式。
Params
可選,其他URL參數(shù)。
Delay
可選,重定向延遲,以秒為單位。
MSG
可選,重定向提示信息。
ThinkPHP redirect instance
在index模塊的index方法中,重定向到該模塊的select操作:
class indexaction extends action{
public function index(){
$this->redirect(“select”,array(“status”=>1),3,“page Jump~”)
]}//直接重定向,不帶延遲
$this->redirect(“select”,array(“status”=>1))
//延遲跳轉,但不帶參數(shù),輸出默認提示
$this->redirect(“select”,“,3) ]//重定向到其他模塊操作
$this->redirect(“public/login”)//重定向到其他組
$this->redirect(“admin public/login”)
可以配置端口轉發(fā)。在虛擬主機中,可以通過NAT網(wǎng)絡分配不同的域名,然后配置iptables映射關系。來自不同端口的請求將被分發(fā)到相應的域名。
怎么實現(xiàn)用一個虛擬主機綁定兩個域名,訪問跳轉不同網(wǎng)站?(php動態(tài)站)?
如果URL包含索引.php也許索引.html跳轉到域名,這些包括,跳轉函數(shù)很容易找到
不是跳轉,只要在php.ini文件設置為以下模塊目錄(&L)模塊(&g)tDirectoryIndexindex.phpindex.htmindex目錄索引. htmldefault.php</IfModule>那就行了