标题 | dedecms系统栏目/文章页面/分页面伪静态详细方法 |
范文 | dedecms系统栏目、文章页面、分页面伪静态和域名301重定向详细方法: 1、服务器必须支持url重写。 2、后台开启伪静态。 3、栏目设置使用动态。 4。添加文档时选择使用动态浏览。 5。需要修改php文件include/channelunit.func.php 查找 return $globals[cfg_plus_dir]./view-.$aid.'-1.html'; 修改为 return /view-.$aid.'-1.html'; 查找 return $globals['cfg_phpurl']./view.php?aid=$aid; 修改为 return /view.php?aid=$aid; 其实不修改也可以,但是url地址会长一点。这个是文章的。 查找 $reurl = $globals['cfg_phpurl']./list.php?tid=.$typeid; 修改为 $reurl = /list-.$typeid..html; 这个必须修改,是栏目页的。 6、需要在根目录下增加一个.htaccess文件(只适用于linux系统,并需要虚拟主机支持)。 添加如下: <ifmodule mod_rewrite.c> rewriteengine on rewritecond %{http_host} ^xianjianhot.com [nc] rewriterule ^(.*)$ http://www.xianjianhot.com/$1 [l,r=301] rewriterule ^list-([0-9]+).html$ /plus/list.php?tid=$1 rewriterule ^list-([0-9]+)-([0-9]+)-([0-9]+).html$ /plus/list.php?tid=$1&totalresult=$2&pageno=$3 rewriterule ^view-([0-9]+)-1.html$ /plus/view.php?arcid=$1 rewriterule ^view-([0-9]+)-([0-9]+).html$ /plus/view.php?aid=$1&pageno=$2 </ifmodule> 说明: 1、 rewritecond %{http_host} ^xianjianhot.com [nc] rewriterule ^(.*)$ http://www.xianjianhot.com/$1 [l,r=301] 此为域名301重定向指令,放在其它重写命令前面。其中域名替换成自己网站域名。这有利于网站的seo。如果不看重则可以不要。 2、 rewriterule ^view-([0-9]+)-([0-9]+).html$ /plus/view.php?aid=$1&pageno=$2 此为文章分页重写命令。如果view替换成自己设置的其他词,则需要把include/arc.archives.class.php文件中的view同时替换掉。 3、 伪静态可能会出现多个url都是指向相同页面,如果看重seo效果,则可用robots.txt屏蔽多余url。 |
随便看 |
|
在线学习网范文大全提供好词好句、学习总结、工作总结、演讲稿等写作素材及范文模板,是学习及工作的有利工具。