星联网络专注帝国CMS二次功能插件开发-精品网站模板站长代码素材

  • 最近更新
  • 模板:33
  • 记录:12641|
  • 插件:52|
  • 工具:4|
  • 代码:8|
  • 评论:0

dedecms栏目页开启伪静态的方法(apache服务器)

前言

本文主要讲解《dedecms栏目页开启伪静态的方法(apache服务器)》的详细内容

在织梦dedecms后台可以开启伪静态功能,但仅有文章页会被伪静态,栏目页的链接依然是动态的。 本节介绍下如何开启栏目页伪静态的方法。 首先,需要给虚拟主机添加上伪静态规则,然后再去织梦dedecms的相关文件中改掉相应的函数。 首先,给虚拟主机加上伪静态规则,Apache和IIS的详细设置如下。 Apache的服务器,就在.htaccess中添加: <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule index.html /index.php RewriteRule plus/list-([0-9]+).html$ /plus/list.php?tid=$1 RewriteRule plus/view-([0-9]+)-([0-9]+).html$ /plus/view.php?arcID=$1&pageno=$3 RewriteRule plus/list-([0-9]+)-([0-9]+)-([0-9]+).html$ /plus/list.php?tid=$1&totalresult=$2&PageNo=$3 </IfModule> IIS的服务器,在httpd.ini中添加如下内容,需要服务器安装过ISAPI Rewrite: [ISAPI_Rewrite] # 缓存3600秒 = 1 小时(hour) CacheClockRate 3600 RepeatLimit 32 RewriteRule ^(.*)/index.html $1/index.php RewriteRule ^(.*)/plus/list-([0-9]+).html $1/plus/list.php?tid=$2 RewriteRule ^(.*)/plus/list-([0-9]+)-([0-9]+)-([0-9]+).html $1/plus/list.php?tid=$2&TotalResult=$3&PageNo=$4 RewriteRule ^(.*)/plus/view-([0-9]+)-([0-9]+).html $1/plus/view.php?arcID=$2&pageno=$3 然后,修改dedecms的程序,打开includechannelunit.func.php。 将以下代码: $reurl = $GLOBALS['cfg_phpurl']."/list.php?tid=".$typeid; 替换为: $reurl = $GLOBALS['cfg_phpurl']."/list-".$typeid.".html";

本网刊登的文章均仅代表作者个人观点,并不代表本网立场。文中的论述和观点,敬请读者注意判断。

本文地址:http://www.xlkjgs.com/notes/web/8167.html

以上内容由本站整理呈现,请务必在转载分享时注明本文地址!如对内容有疑问,请联系我们,谢谢!

星联网络

星联网络是中国最具实战的互联网创业者的知识服务商,这里有互联网行业动态,网络推广,SEO优化,SEM优化,ESC配置,行业经验分型,互联网项目,微信营销、淘宝客赚钱、新媒体营销、京东运营、跨境电商等众多互联网营销知识分享

站长运营站长必备网站运营之道才能长久发展