[教程]
DEDECMS 在 godaddy WIN空间IIS7.0的伪静态设置
|
|
在这论坛注册一段时间了,发现大部分人都是使用LIN的主机,导至WIN主机的伪静态规则很少人写,
自己的站刚搞好伪静态不敢独享,特发出来跟友友们分享,希望对大家有所帮助!有更好的也请大家共享一下谢谢!!
不会正则,模仿加修改(花了N多个小时),终于能正常运行了,不知道写得对不对,说一说让需要的友友们参考
首先,建一个web.config 放在根目录下,web.config 内容为
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Rewrite to index.php">
<match url="/index.html$" />
<action type="Rewrite" url="index.php" />
</rule>
<rule name="Rewrite to list.php">
<match url="^plus/list-([0-9]+).html$" />
<action type="Rewrite" url="plus/list.php\?tid={R:1}" />
</rule>
<rule name="Rewrite to list.php?">
<match url="^plus/list-([0-9]+)-([0-9]+)-([0-9]+).html$" />
<action type="Rewrite" url="plus/list.php\?tid={R:1}&TotalResult={R:2}&PageNo={R:3}" />
</rule>
<rule name="Rewrite to view.php">
<match url="^plus/view-([0-9]+)-([0-9]+).html$" />
<action type="Rewrite" url="plus/view.php\?aid={R:1}&pageno={R:2}" />
</rule>
</rules>
</rewrite>
<httpErrors errorMode="Detailed" />
<asp scriptErrorSentToBrowser="true" />
</system.webServer>
<system.web>
<customErrors mode="Off" />
<globalization requestEncoding="utf-8" resp*****eEncoding="utf-8" fileEncoding="utf-8" />
</system.web>
</configuration>
2、在dedecms 后台的“系统设置”--“基本参数设置”--“核心设置”(核心设置中的“是否使用伪静态”把“是”选上)
这时,“文章内容显示页”的伪静态已经算是设置好了。
3、如果还想将列表页面设置成伪静态的,则要改一下 include 目录下的 channelunit.func.php 文件即 (include/channelunit.func.php )
大约在164行会发现这样的代码:
//动态
$reurl = $GLOBALS['cfg_phpurl']."/list.php?tid=".$typeid;
把这句“$reurl = $GLOBALS['cfg_phpurl']."/list.php?tid=".$typeid; ”注释掉
加上下面的这几句代码
/**修改栏目伪静态 by 27240***/
global $cfg_rewrite;
if($cfg_rewrite == 'Y') {
$reurl = $GLOBALS["cfg_plus_dir"]."/list-".$typeid.".html";
}else{
$reurl = $GLOBALS['cfg_phpurl']."/list.php?tid=".$typeid;
}
/**修改栏目伪静态 by 27240***/
最后保存,好了,试一下,是不是变成伪静态了呢?! (最后要记得,发表文章或建栏目时把“仅动态”选上)
演示地址: http://www.85393.com/
[ 本帖最后由 27240 于 2011-1-12 02:32 AM 编辑 ] |
|
|
|
|
|
|
|
|
|
|
27240
发表于 2011-1-12 02:35:34
|
显示全部楼层
|
|
|
|
|
|
|
|
|
|
zcsln
发表于 2011-1-12 08:44:06
|
显示全部楼层
|
楼主,我也用的DEDECMS,原先也是用的WIN系统可惜DEDECMS运行不起来,可以加你咨询如何在WIN里面配置它运行吗 |
|
|
|
|
|
|
|
|
|
|
add.c
发表于 2011-1-12 09:13:09
|
显示全部楼层
|
|
|
|
|
|
|
|
|
|
27240
发表于 2011-1-12 12:40:22
|
显示全部楼层
原帖由 zcsln 于 2011-1-12 08:44 AM 发表 
楼主,我也用的DEDECMS,原先也是用的WIN系统可惜DEDECMS运行不起来,可以加你咨询如何在WIN里面配置它运行吗
WIN主机的话选择 IIS7.0 PHP 5.0 WIN 是可以完美安装DEDECMS5.3 到5.6的 这个是我亲自测过的!首先进入控制面板到文件管理器那里给权限 然后创建MYSQL 然后安装DEDECMS 就没问题了! |
|
|
|
|
|
|
|
|
|
|
27240
发表于 2011-1-12 12:43:06
|
显示全部楼层
原帖由 add.c 于 2011-1-12 09:13 AM 发表 
收录到 :【总结】GoDaddy主机伪静态设置专题
没想到被版主收录了 感谢!! |
|
|
|
|
|
|
|
|
|
|
zcsln
发表于 2011-1-13 09:22:54
|
显示全部楼层
我现在用的150G的是这样的,不清楚可以吗:
服务器操作系统 Windows_NT
服务器解译引擎 Microsoft-IIS/6.0
PHP版本 4.3.11 |
|
|
|
|
|
|
|
|
|
|
add.c
发表于 2011-1-13 10:39:04
|
显示全部楼层
原帖由 zcsln 于 2011-1-13 09:22 发表 
我现在用的150G的是这样的,不清楚可以吗:
服务器操作系统 Windows_NT
服务器解译引擎 Microsoft-IIS/6.0
PHP版本 4.3.11
你要升级到IIS6才支持php |
|
|
|
|
|
|
|
|
|
|
27240
发表于 2011-1-13 11:38:13
|
显示全部楼层
|
版主正解!!你的IIS6.0要升到IIS7.0才支持php |
|
|
|
|
|
|
|
|
|
|
coogle369
发表于 2011-4-21 13:07:00
|
显示全部楼层
|
|
|
|
|
|
|
|