久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長(zhǎng)資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      關(guān)于WordPress局域網(wǎng)內(nèi)外同時(shí)訪問(wèn)

      下面由WordPress教程欄目給大家介紹關(guān)于WordPress局域網(wǎng)內(nèi)外同時(shí)訪問(wèn) ,希望對(duì)需要的朋友有所幫助!

      我的配置環(huán)境:

      服務(wù)器架設(shè)在家里的電腦上,固定局域網(wǎng)IP:192.168.1.100, 使用電信網(wǎng)絡(luò),有公網(wǎng)IP,但80端口不能用,有自己的域名:www.xxx.cn

      使用花生殼動(dòng)態(tài)域名更新IP到自己的域名。nginx配置虛擬主機(jī)局域網(wǎng)外端口23456,局域網(wǎng)內(nèi)端口80,主頁(yè)目錄一樣。
      WordPress放在網(wǎng)站根目錄下的wordpress文件夾。設(shè)定界面,siteurl和home都設(shè)置的http://www.xxx.cn:23456/wordpress
      外網(wǎng)訪問(wèn)沒(méi)問(wèn)題,內(nèi)網(wǎng)訪問(wèn)http://www.xxx.cn:23456/wordpress,無(wú)法打開(kāi),訪問(wèn)192.168.1.100/wordpress也不可以。
      按照網(wǎng)上的方法,修改數(shù)據(jù)庫(kù)里的siteurl和home為/wordpress, 局域網(wǎng)外訪問(wèn)不正常(有的頁(yè)面能打開(kāi),如管理員界面,但主頁(yè)打不開(kāi))。

      我的解決辦法:

      保持?jǐn)?shù)據(jù)里的設(shè)置http://www.xxx.cn:23456/wordpress不變。按以下說(shuō)明修改wordpresswp-includesoption.php里面的get_option函數(shù)。

      這里只是一個(gè)思路,可以根據(jù)具體情況修改。比如你沒(méi)有使用特殊端口,可以直接將4,5,6行直接寫(xiě)成第5行那樣。

      function get_option( $option, $default = false ) {                          //自己寫(xiě)一個(gè)get_option函數(shù) 	$my_option=my_get_option($option,$default);                         //調(diào)用原來(lái)的函數(shù) 	if($option=="siteurl" || $option == "home"){                        //針對(duì)siteurl和home做修改,其他不變 		if($_SERVER['HTTP_HOST']!="www.xxx.cn"){                  //如果不是用域名訪問(wèn)的 		$my_option="http://".$_SERVER['HTTP_HOST']."/wordpress";  //就跳轉(zhuǎn)到當(dāng)前URL里的服務(wù)器地址,比如本地的localhost或局域網(wǎng)訪問(wèn)的192.168.1.100 		} 	} 	return $my_option; }   function my_get_option( $option, $default = false ) {                       //將原來(lái)的get_option函數(shù)名稱改成my_get_option

      贊(0)
      分享到: 更多 (0)
      網(wǎng)站地圖   滬ICP備18035694號(hào)-2    滬公網(wǎng)安備31011702889846號(hào)