老版地址(仅作固定作用):old.jincong.net

DEDECMS列表页,内容页IIS10伪静态设置,亲测有效

本教程只设置列表页,内容页,TAGS页的伪静态,其他搜索页之类的,太麻烦,水平有限,所以就不测试了。网站运行环境IIS7(10)+PHP+MYSQL,织梦版本:dedecmv5.7。1.你的运行环境必须支持伪静态,自动百度:IISURL重写模块,下载后安......
以下是【金聪采编】分享的内容全文:
本教程只设置列表页,内容页,TAGS页的伪静态,其他搜索页之类的,太麻烦,水平有限,所以就不测试了。网站运行环境 IIS7(10)+PHP+MYSQL,织梦版本:dedecms v5.7。
 
1.你的运行环境必须支持伪静态,自动百度:IIS URL重写模块,下载后安装。
 
 
2.修改后台设置
 
a.后台-系统参数-核心设置-是否使用伪静态:选择“是”;
 
b.后台-系统-SQL命令行工具中执行如下语句:
 
update dede_arctype set isdefault=-1;update dede_archives set ismake=-1;
 
c.修改后面模板文件:/dede/templets/article_add.htm,有两个地方要修改。把默认的“生成生成HTML”选择状态去掉,选中“仅动态浏览”。修改方法:搜索“发布选项”,在下面
 
第一段代码:<input name="ishtml" type="radio" class="np" value="1" checked="1" />把黄色的删除,修改后为
 
<input name="ishtml" type="radio" class="np" value="1" />

 
第二段代码<input name="ishtml" type="radio" class="np" value="0"/>在后面添加:checked="checked",添加后如下:
 
 <input name="ishtml" type="radio" class="np" value="0" checked="checked"/>

 
d.把站点根目录下index.html删除,以后不更新主页HTML即可,当然你也可以选择不使用动态首页;
 
3修改程序文件:
 
a.打开:/include/helpers/channelunit.helper.php
 
搜索:
 
return $GLOBALS["cfg_plus_dir"]."/view-".$aid.'-1.html';

 
替换为:
 
return "/archives/view-".$aid.'-1.html';

 
这个是将文章页默认的/plus/view-1-1.html链接格式改为/archives/view-1-1.html ,你也可以把archives改成其他名字。这里我用的是archives,这里如果修改了,下面的规则里面也要修改成你自己的名字
 
搜索:
 
$reurl = $GLOBALS['cfg_phpurl']."/list.php?tid=".$typeid;

 
替换为:
 
$reurl = "/category/list-".$typeid.".html";

 
这是里让你的频道或是列表页URL变更为/category/list-1.html形式。category你也可修改成其他名字。
 
b.修改列表页分页,打开/include/arc.listview.class.php
 
搜索
 
$plist = str_replace('.php?tid=', '-', $plist);

 
替换成:
 
$plist = str_replace('plus', 'category', $plist);//将默认的plus替换成category$plist = str_replace('.php?tid=', '-', $plist); 
 
这里是修改列表页分页的
 
c.修改文章分页
 
打开/include/arc.archives.class.php,找到获取动态的分页列表GetPagebreakDM()函数末尾片:
 
$PageList = str_replace(".php?aid=","-",$PageList);

 
替换为
 
$plist = str_replace('plus', 'archives', $plist);//将默认的plus替换成archives$PageList = str_replace(".php?aid=","-",$PageList);
 
d.打开/include/taglib/tag.lib.php
 
查找:
 
$row['link'] = $cfg_cmsurl."/tags.php?/".urlencode($row['keyword'])."/";

 
替换为:
 
$row['link'] = $cfg_cmsurl."/tags/".urlencode($row['keyword']).".html";

 
这里是修改TGA标签伪静态的.
 
打开/templets/default/taglist.htm,把里面的TAG标签链接地址/tgas.php修改为/tags.html
 
 
 
4.伪静态规则:把下面代码另存为web.config,放到网站根目录下即可。
 
<?xml version="1.0" encoding="UTF-8"?><configuration>    <system.webServer>        <rewrite>            <rules>   <rule name="首页">                    <match url="^index.html$" ignoreCase="false" />                    <action type="Rewrite" url="index.php" appendQueryString="false" />                </rule>                <rule name="列表页">                    <match url="category/list-([0-9]+).html" ignoreCase="false" />                    <action type="Rewrite" url="/plus/list.php?tid={R:1}" appendQueryString="false" />                </rule>                <rule name="列表分页">                    <match url="^category/list-([0-9]+)-([0-9]+)-([0-9]+).html$" ignoreCase="false" />                    <action type="Rewrite" url="/plus/list.php?tid={R:1}&amp;totalresult={R:2}&amp;PageNo={R:3}" appendQueryString="false" />                </rule><rule name="内容页">                    <match url="^view-([0-9]+)-1.html$" ignoreCase="false" />                    <action type="Rewrite" url="/plus/view.php?arcID={R:1}" appendQueryString="false" />               </rule><rule name="文章分页">                    <match url="^view-([0-9]+)-([0-9]+).html$" ignoreCase="false" />                    <action type="Rewrite" url="/plus/view.php?aid={R:1}&amp;pageno={R:2}" appendQueryString="false" />                </rule>                <rule name="TAGS">                    <match url="tags.html" />                    <conditions>                    </conditions>                    <action type="Rewrite" url="tags.php" appendQueryString="false" />                </rule>                <rule name="TAG列表">                    <match url="^tags/(.*).html$" />                    <action type="Rewrite" url="/tags.php?/{R:1}" />                </rule>                              </rules>        </rewrite>    </system.webServer></configuration>

金聪线报提示:[ DEDECMS列表页,内容页IIS10伪静态设置,亲测有效 ] 仅为会员分享交流,仅供学习、参考使用,请勿用于其他用途,如果想商业使用或者代理,请自行联系版权方获取授权。任何未获取授权的商业使用与本站无关,请自行承担相应责任。
本站不存储任何资源文件,敬请周知!
此资源仅供个人学习、研究使用,禁止非法转播或商业用途,请在获取后24小时内删除,如果你觉得满意,请寻求购买正版或获取授权!
免责申明:本站仅提供学习的平台,所有资料均来自于网络分享线索,版权归原创者所有!本站不提供任何保证,并不承担任何法律责任,如果对您的版权或者利益造成损害,请提供相应的资质证明,我们将于3个工作日内予以处理。版权申诉相关说明
本网站采用 BY-NC-SA 协议进行授权 转载请注明原文链接:DEDECMS列表页,内容页IIS10伪静态设置,亲测有效
221381
领取福利

微信扫码领取福利

微信扫码分享