您现在的位置是:网站首页> 编程资料编程资料
DEDECMS TAG伪静态 IIS_rewrite配置方法附rewrite下载_dedecms_
2023-05-27
288人已围观
简介 DEDECMS TAG伪静态 IIS_rewrite配置方法附rewrite下载_dedecms_
方法
1、因为没有像PHP自带的ReWrite模块,所以需要下载IIS Rewrite模块:
https://www.jb51.net/softs/6192.html
2、将压缩包解压到任意目录,(如:C:\Rewrite)。然后打开“控制面板”-“管理工具”-“IIS信息服务管理器”-“网站”-“您的站点
”-“属性”。在“ISAPI筛选器”项点击 “添加”,筛选器名称填入Rewrite,可执行文件为C:\Rewrite\Rewrite.dll ;
3、然后修改httpd.ini 文件,添加相应的过滤规则,例如:
RewriteRule ^(.*)/([a-z0-9\-\_]+)$ $1/Default\.aspx\?id=$2 [I,O]
http://localhost/Text 就会等同于 http://localhost/Default.aspx?id=Text
RewriteRule ^(.*)/id_([a-z0-9\-]+)\.html$ $1/Default\.aspx\?id=$2 [I,O]
http://localhost/id_Text.html 就会等同于 http://localhost/Default.aspx?id=Text
^(.*)/html/([0-9]+)/([0-9]+)\.html$ $1/Default\.aspx\?id=$2&name=$3
http://localhost/html/001/007.html 就等同于 http://localhost/Default.aspx?id=001&name=007
DEDE的添加方法(注意:这里是正则方式):
RewriteRule ^(.*)/tag/(.+)$ $1/tag\.php\?$2/
RewriteRule ^(.*)/tag/(.+)\.html$ $1/tag\.php\?$2
4、重新启动IIS就可以生效了(这一步很重要,每次修改httpd.ini后都要重启 IIS 以加载配置。)
5、然后修改DEDE相关函数:
\include\inc_arcpart_view.php
\include\inc_channel_unit_functions.php
\include\inc_pubtag_make.php
\include\inc_taglist_view.php
即:把所有链接改为静态地址:tag.php?/ ->tag/
然后再生成相关页面就可以了。
1、因为没有像PHP自带的ReWrite模块,所以需要下载IIS Rewrite模块:
https://www.jb51.net/softs/6192.html
2、将压缩包解压到任意目录,(如:C:\Rewrite)。然后打开“控制面板”-“管理工具”-“IIS信息服务管理器”-“网站”-“您的站点
”-“属性”。在“ISAPI筛选器”项点击 “添加”,筛选器名称填入Rewrite,可执行文件为C:\Rewrite\Rewrite.dll ;
3、然后修改httpd.ini 文件,添加相应的过滤规则,例如:
RewriteRule ^(.*)/([a-z0-9\-\_]+)$ $1/Default\.aspx\?id=$2 [I,O]
http://localhost/Text 就会等同于 http://localhost/Default.aspx?id=Text
RewriteRule ^(.*)/id_([a-z0-9\-]+)\.html$ $1/Default\.aspx\?id=$2 [I,O]
http://localhost/id_Text.html 就会等同于 http://localhost/Default.aspx?id=Text
^(.*)/html/([0-9]+)/([0-9]+)\.html$ $1/Default\.aspx\?id=$2&name=$3
http://localhost/html/001/007.html 就等同于 http://localhost/Default.aspx?id=001&name=007
DEDE的添加方法(注意:这里是正则方式):
RewriteRule ^(.*)/tag/(.+)$ $1/tag\.php\?$2/
RewriteRule ^(.*)/tag/(.+)\.html$ $1/tag\.php\?$2
4、重新启动IIS就可以生效了(这一步很重要,每次修改httpd.ini后都要重启 IIS 以加载配置。)
5、然后修改DEDE相关函数:
\include\inc_arcpart_view.php
\include\inc_channel_unit_functions.php
\include\inc_pubtag_make.php
\include\inc_taglist_view.php
即:把所有链接改为静态地址:tag.php?/ ->tag/
然后再生成相关页面就可以了。
相关内容
- dedecms负载性能优化实例,三招让你的dedecms快10倍以上第1/2页_dedecms_
- DEDE 24小时内发布的信息日期为红色_dedecms_
- 关关小说采集器[杰奇]采集出错的修正方法_杰奇cms_
- 杰奇登录后的东西都是在session里面的_杰奇cms_
- batchcollect pagecollect来自官方杰奇jieqi定时采集配置方法参数详解第1/2页_杰奇cms_
- DEDECMS 重置管理员admin的密码的php文件_dedecms_
- dedecms v5 跳转网址 直接链接而非跳转的实现方法修正版[原创]_dedecms_
- 杰奇1.5官方升级后发现$i不能解析的解决方法_杰奇cms_
- 杰奇jieqi用户评论vip图标显示效果代码[原创]_杰奇cms_
- DeDecms实现更漂亮整齐的缩略图_dedecms_