求ecshop 2.7.3 windows主机下伪静态规则
设置好后清下缓存。然后来配置Rewrite
首先安装此组件需要有服务器操作权限
安装环境:windows2003 + iis
安装说明:
1. 将 Rewrite 文件夹 拷贝到 c:\Rewrite (这里我测试放在别处不行)
2. 在IIS的Isapi上添加这个筛选器, 筛选器名称Rewrite,可执行文件选择 Rewrite.dll
(这步如果让整台服务器上的网站支持,就加在iis上的 网站==>右键 属性==>ISAPI筛选器
,如果只支持一个网站,就加在这一个网站上)
3. 重新启动IIS
4. httpd.ini 是配置文件,如果您了解Rewrite 规则,可以直接对其进行编辑
5. 写好的默认规则为 支持Discuz!6.0.0 与ecshop
httpd.ini 完整 写法如下:
---------------------------------------
[ISAPI_Rewrite]
CacheClockRate 3600
RepeatLimit 32
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
RewriteRule /category-([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+).html
/category\.php\?id=$1&page=$2&sort=$3&order=$4 [I]
RewriteRule ^(.*)/goods-([0-9]+)\.html$ $1/goods.php?id=$2
RewriteRule /article_cat-([0-9]+).html /article_cat\.php\?id=$1 [I]
RewriteRule /article_cat-([0-9]+)-([0-9]+).html
/article_cat\.php\?id=$1&page=$2 [I]
RewriteRule /article_cat-([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+).html
/article_cat\.php\?id=$1&page=$2&sort=$3&order=$4 [I]
RewriteRule /article-([0-9]+).html /article\.php\?id=$1 [I]
RewriteRule /search-b([0-9]+) /search\.php\?brand=$1 [I]
RewriteRule /search-([0-9]+)-([^-]*)-([a-zA-Z]+)-k(.*).html
/search\.php\?page=$1&sort=$2&order=$3&keywords=$4 [I]
RewriteRule
/search-([0-9]+)-([^-]*)-([a-zA-Z]+)-b([0-9]*)-k(.*)-s([0-9]*)-l([0-9]*).html
/search\.php\?page=$1&sort=$2&order=$3&brand=$4&keywords=$5&min_price=$6&max_price=$7
[I]
#discuz
RewriteRule ^(.*)/archiver/((fid|tid)-[\w\-]+\.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
OK 重启IIS 就可以生效啦。