鄭州網站建設始于2004年!QQ咨詢:12269363 聯系電(diàn)話(huà):0371-56688798 手機:13643860807 登錄  注冊  新聞中(zhōng)心   客戶支持   交費(fèi)方式   聯系我(wǒ)(wǒ)們

PHPwind如何在我(wǒ)(wǒ)公司虛拟主機使用僞靜态

發布時間:2010-01-28 21:39:20   浏覽人數: 375926 次  
  關鍵字: PHPwind - 本站搜索 - Google搜索 - Baidu搜索 - Yahoo搜索 - sougo搜索
  關鍵字: 僞靜态 - 本站搜索 - Google搜索 - Baidu搜索 - Yahoo搜索 - sougo搜索
我(wǒ)(wǒ)公司虛拟主機配置爲IIS+ISAPI URL_reWrite3
在Phpwind 7.5系統中(zhōng)開(kāi)啓僞靜态并進行以下(xià)操作
 
首先您需要建立一(yī)個FTP中(zhōng)的www目錄裏新建一(yī)個名爲.htaccess的文件,并插入以下(xià)代碼後保存:
RewriteEngine On
RewriteRule ^commtopics-(.*)-(.*) thread.php?fid=$1&page=$2
RewriteRule ^commtopics-(.*) thread.php?fid=$1&page=$2
RewriteRule ^article-(.*)-(.*)-(.*).html read.php?tid=$1&page=$2&fpage=$3
RewriteRule ^article-(.*)-(.*).html read.php?tid=$1&page=$2&fpage=$3
RewriteRule ^article-(.*).html read.php?tid=$1
RewriteRule ^(.*)-htm-(.*)$ $1.php?$2
RewriteRule ^(.*)/simple/([a-z0-9_]+.html)$ $1/simple/index.php?$2
 
 然後将global.php打開(kāi),找到523行,替換以下(xià)函數

function Htm_cv($url,$tag){
global $db_dir,$db_ext;
$tmppos = strpos($url,'#');
$add = $tmppos!==false ? substr($url,$tmppos) : '';
$url = str_replace(
array('.php?','=','&','&',$add),
array($db_dir,'-','-','-',''),
$url
).$db_ext.$add;
return stripslashes($tag)."$url"";

  全部替換爲:
 
function Htm_cv($url, $tag){//modify By Josh
global $db_dir, $db_ext;
if (!preg_match('/^(http|ftp|telnet|mms|rtsp)|admin.php|rss.html/i', $url)){
$add = strpos($url, '#') !== false ? substr($url, strpos($url, '#')) : '';
if(strpos($url, 'thread.php?') !== false){
unset($rw); //$rw->type $ru->array
$thread_arr = explode('&', substr(str_replace($add, '', $url), 11));
foreach($thread_arr as $key => $value){
$ru = explode('=', $value, 2);
if($ru['1']){
switch($ru['0']){
case 'fid':
$rw['fid'] = $ru['1'];
$rw['type'] < 1 && $rw['type'] = 1;
break;
case 'page':
$rw['page'] = $ru['1'];
$rw['type'] < 2 && $rw['type'] = 2;
break;
default:
$rw['type'] = 4;
$urlfail = 1;
break;
}}}
switch($rw['type']){
case '1':
$url = "commtopics-" . $rw['fid'] ; break;
case '2':
$url = "commtopics-" . $rw['fid'] . "-" . $rw['page'] ; break;
}}elseif(strpos($url, 'read.php?') !== false){
unset($rw);
$read_arr = explode('&', substr(str_replace($add, '', $url), 9));
foreach($read_arr as $key => $value){
$ru = explode('=', $value, 2);
if($ru['1']){
switch($ru['0']){
case 'tid':
$rw['tid'] = $ru['1'];
$rw['type'] < 1 && $rw['type'] = 1;
break;
case 'page':
$rw['page'] = $ru['1'];
$rw['type'] < 2 && $rw[type] = 2;
break;
case 'fpage':
$rw['fpage'] = $ru['1'];
$rw['type'] < 3 && $rw['type'] = 3;
break;
default:
$rw['type'] = 4;
$urlfail = 1;
break;
}}}
switch($rw['type']){
case '1':
$url = "article-".$rw['tid'] . ".html";
break;
case '2':
$url = "article-".$rw['tid'] . "-" . $rw['page'] . ".html";
break;
case '3':
$url = "article-". $rw['tid'] . "-" . $rw['page'] . "-" . $rw['fpage'] . ".html";
break;
}
}
if($urlfail){
$url = str_replace(
array('.php?', '=', '&', $add),
array($db_dir, '-', '-', ''),
$url
) . $db_ext . $add;
}
}
return stripslashes($tag) . "$url"";



上一(yī)篇:有沒有不用備案的主機?
下(xià)一(yī)篇:FTP 狀态代碼及其原因
電(diàn)話(huà):0371-56688798  手機:13643860807
QQ12269363 Emailzzqqwl@zzqqwl.com 備案号:豫ICP14014950
廈門悟網科技有限公司 版權所有 本站程序界面、源代碼受相關法律保護,未經授權,嚴禁使用
Copyright © 2004-2020 www.zzqqwl.com. All rights reserved 
以下(xià)js爲測試信息