帝国cms网站优化值tags伪静态的实现步骤如下:
1.修改e/class/t_functions.php中的sys_eShowTags函数
//显示TAGS
function sys_eShowTags($cid,$num=0,$line=0,$order='',$isgood='',$isgoodshow='',$showjg='',$shownum=0,$cs=''){
global $empire,$dbtbpre,$public_r,$navinfor;
$str='';
if(empty($showjg))
{
$showjg=' ';
}
$ln=0;
if($cid=='selfinfo')
{
if(empty($navinfor['infotags']))
{
return '';
}
$jg='';
$r=explode(',',$navinfor['infotags']);
$count=count($r);
for($i=0;$i<$count;$i++)
{
$ln++;
$br='';
if($line)
{
if($ln%$line==0)
{
$br='
';
}
}
$str.=$jg.''.$r[$i].''.$br;
$jg=$br?'':$showjg;
}
}
else
{
$and='';
$where='';
if($cid)
{
$where=strstr($cid,',')?"cid in ($cid)":"cid='$cid'";
$and=' and ';
}
if($isgood)
{
$where.=$and.'isgood=1';
}
if($where)
{
$where=' where '.$where;
}
$order=$order?' '.$order:' tagid desc';
$limit='';
if($num)
{
$limit=' limit '.$num;
}
//推荐标红
$gfont1='';
$gfont2='';
if($isgoodshow)
{
if(strstr($isgoodshow,'r'))
{
$gfont1='';
$gfont2='';
}
if(strstr($isgoodshow,'s'))
{
$gfont1=$gfont1.'';
$gfont2=''.$gfont2;
}
}
$jg='';
$snum='';
$sql=$empire->query("select tagid,tagname,num,isgood from {$dbtbpre}enewstags".$where." order by".$order.$limit);
while($r=$empire->fetch($sql))
{
if($shownum)
{
$snum='('.$r[num].')';
}
$font1='';
$font2='';
if($isgoodshow&&$r[isgood])
{
$font1=$gfont1;
$font2=$gfont2;
}
$ln++;
$br='';
if($line)
{
if($ln%$line==0)
{
$br='
';
}
}
//$str.=$jg.''.$font1.$r[tagname].$snum.$font2.''.$br;
$str.=$jg.''.$font1.$r[tagname].$snum.$font2.''.$br;
$jg=$br?'':$showjg;
}
}
echo $str;
}
2.网站根目录 增加.htaccess文件,内容如下
RewriteEngine On RewriteBase / RewriteRule tag/(.*).html$ e/tags/?tagname=$1 RewriteRule e/tags/(.*).html$ e/tags/?tagid=$1
还要空间支持伪静态
1.检测Apache是否支持mod_rewrite 通过php提供的phpinfo()函数查看环境配置,通过Ctrl+F查找到“Loaded Modules”,其中列出了所有apache2handler已经开启的模块,如果里面包括“mod_rewrite”,则已经支持,不再需要继续设置。
如果没有开启“mod_rewrite”,则打开目录 您的apache安装目录“/apache/conf/” 下的 httpd.conf 文件,通过Ctrl+F查找到“LoadModule rewrite_module”,将前面的”#”号删除即可。
如果没有查找到,则到“LoadModule” 区域,在最后一行加入“LoadModule rewrite_module modules/mod_rewrite.so”(必选独占一行),然后重启apache服务器即可。
2.让apache服务器支持.htaccess
修改httpd.conf文件
Options FollowSymLinks AllowOverride None
改为
Options FollowSymLinks AllowOverride All
VPS就是在物理服务器中分割出多个虚拟分区,每个分区都拥有独立的操作系统、内存、磁盘和带宽,可以自主开机、关机、重启以及安装软件应用和配置环境等等,在使用体验上和一台真正的独立服务器没有区别。简而言之,VPS就是让你用更少的钱享受到和独立服务器相同的体验,以及比虚拟主机更多的硬件资源。
如果你希望享受到比虚拟主机更多的功能和硬件资源配额,但是又无法承受独立服务器的高成本,那么VPS可能是你最理想的选择。通过选择“VPS”,可以以更低的成本享受到和一台真正的独立服务器同样的体验。如果需要更多资源,还可以在商家后台可以一键升级套餐。
VPSNO一直致力于发布全球主机商的便宜VPS,包含便宜 Linux VPS、便宜 Windows VPS和独立服务器的最新促销信息。可以通过每天浏览本站或是订阅我们的RSS源,以确保您不会错过最优惠的价格。

