最全的伪静态规则和设置方法.doc
文本预览下载声明
最近陆续有很多站长过来询问伪静态的问题,现就分享下目前网上流行的各种程序在iis下的规则和设置方法:
1、shopex4.8
下载3.0的免费Rewrite组件 /download/isapi_rewrite/ISAPI_Rewrite3_0056_Lite.msi
按照默认路径安装后,打开C:\Program Files\Helicon\ISAPI_Rewrite3\httpd.conf
加入以下规则:
# Helicon ISAPI_Rewrite configuration file
# Version 6
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=$2extra=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的权限。
2、Discuz6+ecshop
规则如下:
[ISAPI_Rewrite]
# 3600 = 1 hour
CacheClockRate 3600
RepeatLimit 32
# Protect httpd.ini and httpd.parse.errors files
# from accessing through HTTP
RewriteCond %{HTTP_HOST}
RewriteRule /index.html /index.php [I]
RewriteRule /default.html /index.php [I]
RewriteRule /feed.xml /feed.php [I]
RewriteRule /category-([0-9]+).html /category\.php\?id=$1 [I]
RewriteRule /category-([0-9]+)-([0-9]+).html /category\.php\?id=$1page=$2 [I]
显示全部