伪静态在iis下的规则和设置方法
来源:asp之家 发布时间:2009-10-18 07:28:00
最近陆续有很多站长过来询问伪静态的问题,现就分享下目前网上流行的各种程序在iis下的规则和设置方法:
shopex4.8
下载3.0的免费Rewrite组件 http://www.helicontech.com/download/isapi_rewrite/ISAPI_Rewrite3_0056_Lite.msi
按照默认路径安装后,打开C:Program FilesHeliconISAPI_Rewrite3httpd.conf
加入以下规则:
# Helicon ISAPI_Rewrite configuration file
# Version 3.1.0.56
RewriteBase /
RewriteCond %{REQUEST_FILENAME} .(html|htm|php|php2|php3|php4|php5|phtml|pwml|inc|asp|aspx|ascx|jsp|cfm|cfc|pl|cgi|shtml|shtm|phtm|xml)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?$1 [L]
[ISAPI_Rewrite]
# 3600 = 1 hour
CacheClockRate 3600
RepeatLimit 32
# Protect httpd.ini and httpd.parse.errors files
# from accessing through HTTP
RewriteRule ^(.*)/archiver/((fid|tid)-[0-9]+.html)?*(.*)$ $1/archiver/index.php?$2&$4
RewriteRule ^(.*)/forum-([0-9]+)-([0-9]+).html?*(.*)$ $1/forumdisplay.php?fid=$2&page=$3&$4
RewriteRule ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+).html?*(.*)$ $1/viewthread.php?tid=$2&extra=page%3D$4&page=$3&$4
RewriteRule ^(.*)/space-(username|uid)-(.+).html?*(.*)$ $1/space.php?$2=$3&$4
RewriteRule ^(.*)/tag-(.+).html?*(.*)$ $1/tag.php?name=$2&$3
下面就需要配置iis为shopex4.8加载组件了:
打开iis,右键你的站点属性--ISAPI 筛选器--添加--筛选器名称是ISAPI_Rewrite3 --可执行文件就是ISAPI_Rewrite.dll的路径,比如C:Program FilesHeliconISAPI_Rewrite3ISAPI_Rewrite.dll
最后重启iis
当然你可以把ISAPI_Rewrite3目录放入站点根目录下,但记得要给一个users和"network service"的读权限。
注意:有些服务器或者vps有做权限的,安装后httpd.conf可能只有everyone和system的权限,如果修改不了文件就添加一个administrator的权限。
shopex4.7
免费的rewrite2.0组件下载地址 http://www.isapirewrite.com/download/isapi_rwl_x86_0072.msi
安装后添加如下规则
规则如下:
[ISAPI_Rewrite]
# 3600 = 1 hour
CacheClockRate 3600
RepeatLimit 32
#首页
RewriteRule /index.html /index.php
RewriteRule /default.html /index.php
#商店公告
RewriteRule /bulletin.html /index.php?gOo=article_list.dwt&acat=1
RewriteRule /bulletin_([0-9]+).html /index.php?gOo=article_list.dwt&acat=1&p=$1
#商品分类
RewriteRule /catalog.html /index.php?gOo=goods_category.dwt
#全部商品
RewriteRule /list.html /index.php?gOo=goods_search_list.dwt
RewriteRule /list_([0-9]+).html /index.php?gOo=goods_search_list.dwt&p=$1
#会员中心
RewriteRule /member.html /index.php?gOo=member_home.dwt
#帮助中心与常见问题
RewriteRule /faq.html /index.php?gOo=help.dwt&acat=2
RewriteRule /faq_([0-9]+).html /index.php?gOo=help.dwt&acat=2&p=$1
#安全交易
RewriteRule /safe.html /index.php?gOo=help_safe.dwt
#购买流程
RewriteRule /howtobuy.html /index.php?gOo=help_buystep.dwt
#如何付款
RewriteRule /howtopay.html /index.php?gOo=help_send.dwt
#联系我们
RewriteRule /contactus.html /index.php?gOo=help_contact.dwt
#关于我们
RewriteRule /aboutus.html /index.php?gOo=help_copyright.dwt
#顾客留言
RewriteRule /feedback.html /index.php?gOo=shopbbs.dwt
#友情链接
RewriteRule /friendlink.html /index.php?gOo=linkmore.dwt
#用户注册
RewriteRule /register.html /index.php?gOo=register_1.dwt
#忘记密码
RewriteRule /lostpass.html /index.php?gOo=forget.dwt
#商品详细页
RewriteRule /product/([0-9]+).html /index.php?gOo=goods_details.dwt&goodsid=$1
RewriteRule /product_([0-9]+).html /index.php?gOo=goods_details.dwt&goodsid=$1
RewriteRule /([0-9]+)_([^.]*).html /index.php?gOo=goods_details.dwt&goodsid=$1
#新闻详细页
RewriteRule /article_([0-9]+).html /index.php?gOo=help_details.dwt&articleid=$1
RewriteRule /message_([0-9]+).html /index.php?gOo=article_details.dwt&articleid=$1
#分类详细列表
RewriteRule /catalog_([0-9]+).html /index.php?gOo=goods_search_list.dwt&gcat=$1
RewriteRule /catalog_([0-9]+)_([0-9]+).html /index.php?gOo=goods_search_list.dwt&gcat=$1&p=$2
#收藏商品
RewriteRule /addtofavorites_([0-9]+).html /index.php?gOo=addmembergoods.do&goodsid=$1
#首页上的最新,推荐,特价商品
RewriteRule /list_([a-zA-Z]+).html /index.php?gOo=goods_search_list.dwt>ype=$1
RewriteRule /list_([a-zA-Z]+)_([0-9]+).html /index.php?gOo=goods_search_list.dwt>ype=$1&p=$2
下面就需要配置iis为shopex4.7加载组件了,方法类似shopex4.8:
打开iis,右键你的站点属性--ISAPI 筛选器--添加--筛选器名称是Rewrite --可执行文件就是Rewrite.dll的路径,比如E:homeLocalUserrewriteRewrite.dll
最后重启iis
rewrite.dll以及规则可以放入任何一个目录,但记得要给该目录一个users的读权限。
以上就是shopex4.8和shopex4.7的规则以及配置方法。如果iis内有其它程序比如discuz、phpwind之类的,就可能会相互有影响,那么就打开iis,
右键网站属性--ISAPI 筛选器--删除isapi_rewrite这项,因为这里是对整个iis进行设置的,会造成其它程序的冲突。
注意isapi_rewrite3.0和isapi_rewrite2.0不能混用。
因为篇幅问题,现在再把shopex4.7/4.8、discuz6/NT2.5、ecshop、dvbbs、phpwind、wordpress、Discuz6+ecshop等伪静态规则和组件打包进行下载。
以上设置都是针对租用了独立服务器和vps的,在使用虚拟主机的就不用看了,因为作为服务商是应该做好了的,但目前还没有出现对所有流行程序都支持的吧。
猜你喜欢
- WordPress是一种使用PHP语言开发的免费开源的博客平台,在世界范围内广受欢迎,是使用量最大的独立博客系统之一,原先的WordPres
- 远程桌面服务所使用的通信协议是Microsoft定义RDP(Reliable Data Protocol)协议,RDP协
- 最新消息,康盛创想(Comsenz)核心社区产品Discuz!NT 3.0版本官方已经测试上线。作为一款引领社区论坛开放潮流的ASP.net
- 众所周知,Linux虽然在桌面应用上赶不上Windows普及和易用,但也恰恰是因为其看起来很麻烦的命令行操作,使得其在安全性方面要优于为了易
- 在博客一年的时间里,就我个人而言,我学到了很多东西,不管是博客以外还是以内的,如果你还没有建立自己的博客,我建议你马上建立,并固定地更新,你
- 增加链接的途径1。找您朋友的网站帮您加您网站的链接。单向链接对您网站效果最好。2。在google和baidu查询您网站的主题。看看排名第一页
- 从昨晚开始,部分国内用户在访问谷歌Google页面时,发现了一些令人惊奇的现象.在搜索栏下方出现了一排动态图标,展示了谷歌中国的7款产品,包
- 北京时间10月27日消息,据国外媒体报道,百度(纳斯达克:BIDU)首席执行官李彦宏于周二透露百度客户将于2009年12月1日全面向凤巢系统
- 腾讯QQ密保卡是腾讯推出的一项帐号安全保护服务。它是一个记录着10行8列数字的卡片,在执行敏感操作(如在幻想游戏中转让装备、修改QQ密码)时
- 网站终于做好了,接下来要做的就要把网站发布出去。使用尽可能多的方法将网站推广出去,最大限度的让更多的人知道你网站,来获取更多流量才是关键。但
- 广受大家欢迎的发布平台WordPress上个月发布了WordPress 3.0正式版 (取名 “Thelonious”)。此版本引入了非常多
- 前日,山东冠县政府称关闭网吧系安民心举措,被质疑为公权滥用。昨日冠县有关部门表示,网吧被整顿有法可依。目前网吧恢复营业尚无时间表。冠县网吧被
- 您在生成广告代码的过程中,会有一个步骤是选择广告单元的格式,这一步骤非常关键。不同的广告格式效果差异非常大,选择好的广告格式可以显著提高您的
- 在"授权模式"对话框,选择客户端的授权模式,可以是"每客户"或"每服务器"方式。
- 如果说病毒制造者是造成目前网络上病毒肆虐的罪魁祸首,那么为病毒四处传播“提供”渠道的各种网络通信形式
- ProFTPD是一个Unix平台上或是类Unix平台上(如Linux,FreeBSD等)的FTP服务器程序,它是在自由软件基金会的版权声明(
- 非主流闪图一直是“美图秀秀[点击下载]”软件的重点功能之一,操作简单,动感十足,深受非主流一族的喜爱
- 今天闲来无事搜索自己的网名,这一搜不要紧竟然发现自己的一篇文章被n多人转载了,这之前我都没看到自己投递的文章通过了,(大半夜随手写完就睡觉了
- 3月2日,权威调研机构CCID(赛迪顾问,直属工信部电子信息产业研究院)正式发布《2009-2010年度中国服务器市场研究报告》,报告显示,
- 本文假定读者已经理解双机互备的HA方案的基本概念。1. 双机互备HA方案的基本步骤建立一个双机互备方案的基本步骤是:1. 确定基本参数(如I