,dede织梦搜索伪静态,伪静态设置成功后,访问URL地址效果如下:, ,搜索页 http://www.baidu.com/search/织梦.html, ,搜索分页 http://www.baidu.com/search/织梦-2.html, ,本教程也适用于手机端。, ,开启伪静态:, ,后台-系统参数-核心设置-开启伪静态,后台-系统参数-核心设置-关闭多站点支持, ,修改程序文件:, ,1、打开 /plus/search.php 找到, ,$mid = (isset($mid) && is_numeric($mid)) ? $mid : 0;, ,在它下面加入:, ,if ( $mobile==1 ),{, define('DEDEMOB', 'Y');,}, ,继续找到, ,$t1 = ExecTime();, ,在它下面加入, ,$keyword = preg_replace("/-(d+)/i",'',$keyword);,$oldkeyword = preg_replace("/-(d+)/i",'',$oldkeyword);, ,2、打开 /include/arc.searchview.class.php 搜索, ,global $oldkeyword;, ,修改为, ,global $oldkeyword, $cfg_rewrite;, ,继续找到, ,$purl .= "?".$geturl;, ,修改为, ,if($cfg_rewrite != 'Y' && !defined('DEDEMOB')),{, $purl .= "?".$geturl;,},else,{, $purl = '/search/'.urlencode($oldkeyword);,}, ,继续找到, ,return $plist;, ,修改为, ,if($cfg_rewrite == 'Y'),{,$plist = preg_replace("/PageNo=(d+)/i",'-.html',$plist);,},return $plist;, ,本文以Nginx伪静态规则为例,规则如下, ,rewrite ^/search/(.*)-([0-9]+).html$ /plus/search.php?q=$1&PageNo=$2&pagesize=10&searchtype=title;,rewrite ^/search/(.*).html$ /plus/search.php?q=$1&pagesize=10&searchtype=title;