|
最近陆续有很多站长过来询问伪静态的问题,现就分享下目前网上流行的各种程序在iis下的规则和设置方法:
shopex4.8 下载3.0的免费Rewrite组件 http://www.helicontech.com/download/isapi_rewrite/ISAPI_Rewrite3_0056_Lite.msi 按照默认路径安装后,打开C:\Program Files\Helicon\ISAPI_Rewrite3\httpd.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=$2page=$3&$4 RewriteRule ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html\?*(.*)$ $1/viewthread\.php\?tid=$2&extra=page\%3D$4page=$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 Files\Helicon\ISAPI_Rewrite3\ISAPI_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 |
【收藏】【打印】【进入论坛】 |
|
|
|
|
|
|
|