=
PHPwind如何在我公司虚拟主机使用伪静态
发布时间:2010-01-28 21:39:20   浏览人数: 430793 次  
  关键字: PHPwind - 本站搜索 - Google搜索 - Baidu搜索 - Yahoo搜索 - sougo搜索
  关键字: 伪静态 - 本站搜索 - Google搜索 - Baidu搜索 - Yahoo搜索 - sougo搜索
我公司虚拟主机配置为IIS+ISAPI URL_reWrite3
在Phpwind 7.5系统中开启伪静态并进行以下操作
 
首先您需要建立一个FTP中的www目录里新建一个名为.htaccess的文件,并插入以下代码后保存:
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打开,找到523行,替换以下函数

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.php/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"";

看不明白该文挡,发信息给我们:
用户: * 密码: * (需要登陆
标题:
内容:

查询关键词字:   
PHPwind如何在我公司虚拟主机使用伪静态
发布时间:2010-01-28 21:39:20   浏览人数: 430793 次  

  关键字: PHPwind - 本站搜索 - Google搜索 - Baidu搜索 - Yahoo搜索 - sougo搜索
  关键字: 伪静态 - 本站搜索 - Google搜索 - Baidu搜索 - Yahoo搜索 - sougo搜索
我公司虚拟主机配置为IIS+ISAPI URL_reWrite3
在Phpwind 7.5系统中开启伪静态并进行以下操作
 
首先您需要建立一个FTP中的www目录里新建一个名为.htaccess的文件,并插入以下代码后保存:
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打开,找到523行,替换以下函数

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.php/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"";

更多相关连接
看不明白该文挡,发信息给我们:
用户: * 密码: * (需要登陆
标题:
内容:

联系我们

销售电话(400-151-5798)

售后服务(3366365-808)

服务邮箱(service@xpp.cn)

加盟QQ(1405520588)

微信公众号
关于我们

中华人民共和国增值电信业务经营许可证: B2-20150291

小胖传播 ? 版权所有 Copyright ? 2000-2024 XPP.cn. All rights reserved  备案号码:粤ICP备17140174号

声明:本网站中所使用到的其他各种版权内容,包括但不限于文章、图片、视频、音频、字体等内容版权归原作者所有,如权利所有人发现,请及时告知,以便我们删除版权内容

小胖传播 ? 版权所有 Copyright ? 2000-2017 NiceNIC.net,Inc. All rights reserved  备案号:粤ICP备17140174号

声明:本网站中所使用到的其他各种版权内容,包括但不限于文章、图片、视频、音频、字体等内容版权归原作者所有,如权利所有人发现,请及时告知,以便我们删除版权内容

产品

域名注册 软文代写 海报设计
多词推 品牌推 全球推
媒体营销 微博营销 微信营销 论坛营销 视频营销