久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放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. 站長資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

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

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

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

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

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

      我的解決辦法:

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

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

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

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