dede多城市伪静态经典程序

  dede多城市伪静态经典程序

  1.伪静态设置.htcess

  如果是apache的是规则是这样的:

  RewriteEngine On

  RewriteRule ^([A-Za-z0-9]+)/$ /index.php?area=$1

  RewriteRule ^([A-Za-z]+)/list_([0-9]+)/$ /plus/list.php?area=$1&tid=$2

  RewriteRule ^([A-Za-z]+)/list_([0-9]+)/([0-9]+)/([0-9]+)/$ /plus/list.php?area=$1&tid=$2&totalresult=$3&PageNo=$4

  RewriteRule ^([A-Za-z]+)/([0-9]+)/$ /plus/list.php?area=$1&tid=$2

  RewriteRule ^([A-Za-z]+)/view/([0-9]+)\.html$ /plus/view.php?area=$1&arcID=$2

  如果是ngnix的规则是这样的:

  rewrite ^/blog/$ /blog/index.php;

  rewrite ^/([A-Za-z0-9]+)/$ /index.php?area=$1;

  rewrite ^/([A-Za-z]+)/list_([0-9]+)/$ /site/list.php?area=$1&tid=$2;

  rewrite ^/([A-Za-z]+)/list_([0-9]+)/([0-9]+)/([0-9]+)/$ /site/list.php?area=$1&tid=$2&totalresult=$3&PageNo=$4;

  rewrite ^/([A-Za-z]+)/([0-9]+)/$ /site/list.php?area=$1&tid=$2;

  rewrite ^/([A-Za-z]+)/view/([0-9]+).html$ /site/view.php?area=$1&arcID=$2;

  2.导入多城市拼音字段

  见附录city.sqldede_area

  注意数据库编码

  3.修改/include/dedetag.class.php中

  function Display()

  {

  $area = $_GET[‘area’];

  if($area==””){

  $area=0;

  }

  $conn = mysql_connect(“localhost”, “root”, “123456”);

  mysql_select_db(“hu07″,$conn);

  mysql_query(“set names ‘GBK'”);

  $sql= “select name,oname from dede_area where oname=’$area'”;

  $query = mysql_query($sql, $conn);

  $row=mysql_fetch_row($query);

  $a=array(“[area]”,”[areaid]”);

  $b= array($row[0],$row[1]);

  echo str_replace($a,$b,$this->GetResult());

  //echo $this->GetResult();

  }

  修改相应的数据库信息

  4.修改include/helpers/channelunit.helper.php中

  function GetTypeUrl($typeid,$typedir,$isdefault,$defaultname,$ispart,$namerule2,$moresite=0,$siteurl=”,$sitepath=”)

  {

  global $cfg_typedir_df;

  $typedir = MfTypedir($typedir);

  $sitepath = MfTypedir($sitepath);

  if($isdefault==-1)

  {

  //动态

  //$reurl = $GLOBALS[‘cfg_phpurl’].”/list.php?tid=”.$typeid;

  if($_GET[‘area’]){

  $reurl = “/”.$_GET[‘area’].”/list_”.$typeid.”/”;

  }else{

  $reurl = $GLOBALS[‘cfg_phpurl’].”/list.php?tid=”.$typeid;

  }

  可以修改相应的链接信息

  5.如无特殊情况直接覆盖multicity里面的文件,并修改上述第三步中的数据库即可multicity

此条目发表在dedecms参考分类目录,贴了标签。将固定链接加入收藏夹。

发表评论

邮箱地址不会被公开。 必填项已用*标注

您可以使用这些HTML标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>