Home > 服务器 > ecshop在Win2008IIS7.5下可用的伪静态规则

ecshop在Win2008IIS7.5下可用的伪静态规则

服务器环境如下:
OS:Win2008 R2 64BIT
Web 服务器:Microsoft-IIS/7.5
Fastcgi模式
URL Rewrite Module 2.0(下载地址:http://www.iis.net/download/URLRewrite
PHP 版本:5.3.24
ECShop 版本:v2.7.3 RELEASE 20120411
编码:UTF-8

因为懒,就在网上找了N次方个规则,结果没有一个能正常使用的(包括EC安装包里的静态规则,在以上的环境中也无法正常使用)。看来还是需要自己动手,才能丰衣足食。

iis7.5的站点都有web.config,将以下规则拷贝过来,在后台开启伪静态再清除缓存,代码如下:

 

<?xml version=”1.0″ encoding=”UTF-8″?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name=”index”>
<match url=”^index.html” />
<action type=”Rewrite” url=”index.php” />
</rule>
<rule name=”category 0″>
<match url=”^category$” />
<action type=”Rewrite” url=”index.php” />
</rule>
<rule name=”feed category”>
<match url=”^feed-c([0-9]+).xml$” />
<action type=”Rewrite” url=”feed.php?cat={R:1}” />
</rule>
<rule name=”feed brand”>
<match url=”^feed-b([0-9]+).xml$” />
<action type=”Rewrite” url=”feed.php?brand={R:1}” />
</rule>
<rule name=”feed type”>
<match url=”^feed-type([^-]+).xml$” />
<action type=”Rewrite” url=”feed.php?type={R:1}” />
</rule>
<rule name=”feed”>
<match url=”^feed.xml$” />
<action type=”Rewrite” url=”feed.php” />
</rule>
<rule name=”category 1″>
<match url=”^category-([0-9]+)-b([0-9]+)-min([0-9]+)-max([0-9]+)-attr([^-]*)-([0-9]+)-(.+)-([a-zA-Z]+)(.*).html” />
<action type=”Rewrite” url=”category.php?id={R:1}&brand={R:2}&price_min={R:3}&price_max={R:4}&filter_attr={R:5}&page={R:6}&sort={R:7}&order={R:8}” />
</rule>
<rule name=”category 2″>
<match url=”^category-([0-9]+)-b([0-9]+)-min([0-9]+)-max([0-9]+)-attr([^-]*)(.*).html” />
<action type=”Rewrite” url=”category.php?id={R:1}&brand={R:2}&price_min={R:3}&price_max={R:4}&filter_attr={R:5}” />
</rule>
<rule name=”category 3″>
<match url=”^category-([0-9]+)-b([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*).html” />
<action type=”Rewrite” url=”category.php?id={R:1}&brand={R:2}&page={R:3}&sort={R:4}&order={R:5}” />
</rule>
<rule name=”category 4″>
<match url=”^category-([0-9]+)-b([0-9]+)-([0-9]+)(.*).html” />
<action type=”Rewrite” url=”category.php?id={R:1}&brand={R:2}&page={R:3}” />
</rule>
<rule name=”category 5″>
<match url=”^category-([0-9]+)-b([0-9]+)(.*).html” />
<action type=”Rewrite” url=”category.php?id={R:1}&brand={R:2}” />
</rule>
<rule name=”category 6″>
<match url=”^category-([0-9]+)(.*).html” />
<action type=”Rewrite” url=”category.php?id={R:1}” />
</rule>
<rule name=”category 7″>
<match url=”^category-([0-9]+)-b([0-9]+).html(.*)$” ignoreCase=”false” />
<action type=”Rewrite” url=”category.php?{R:3}&id={R:1}&brand={R:2}” />
</rule>
<rule name=”goods”>
<match url=”^goods-([0-9]+)(.*).html” />
<action type=”Rewrite” url=”goods.php?id={R:1}” />
</rule>
<rule name=”article 0″>
<match url=”^article_cat-([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*).html” />
<action type=”Rewrite” url=”article_cat.php?id={R:1}&page={R:2}&sort={R:3}&order={R:4}” />
</rule>
<rule name=”article 1″>
<match url=”^article_cat-([0-9]+)-([0-9]+)-(.+)(.*).html” />
<action type=”Rewrite” url=”article_cat.php?id={R:1}&page={R:1}&keywords={R:2}” />
</rule>
<rule name=”article 2″>
<match url=”^article_cat-([0-9]+)-([0-9]+)(.*).html” />
<action type=”Rewrite” url=”article_cat.php?id={R:1}&page={R:2}” />
</rule>
<rule name=”article 3″>
<match url=”^article_cat-([0-9]+)(.*).html” />
<action type=”Rewrite” url=”article_cat.php?id={R:1}” />
</rule>
<rule name=”article 4″>
<match url=”^article-([0-9]+)(.*).html” />
<action type=”Rewrite” url=”article.php?id={R:1}” />
</rule>
<rule name=”brand 0″>
<match url=”^brand-([0-9]+)-c([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+).html” />
<action type=”Rewrite” url=”brand.php?id={R:1}&cat={R:2}&page={R:3}&sort={R:4}&order={R:5}” />
</rule>
<rule name=”brand 1″>
<match url=”^brand-([0-9]+)-c([0-9]+)-([0-9]+)(.*).html” />
<action type=”Rewrite” url=”brand.php?id={R:1}&cat={R:2}&page={R:3}” />
</rule>
<rule name=”brand 2″>
<match url=”^brand-([0-9]+)-c([0-9]+).html(.*)$” />
<action type=”Rewrite” url=”brand.php?{R:3}&id={R:1}&cat={R:2}” />
</rule>
<rule name=”brand 3″>
<match url=”^brand-([0-9]+)-c([0-9]+)(.*).html” />
<action type=”Rewrite” url=”brand.php?id={R:1}&cat={R:2}” />
</rule>
<rule name=”brand 4″>
<match url=”^brand-([0-9]+)(.*).html” />
<action type=”Rewrite” url=”brand.php?id={R:1}” />
</rule>
<rule name=”tag”>
<match url=”^tag-(.*).html” />
<action type=”Rewrite” url=”search.php?keywords={R:1}” />
</rule>
<rule name=”snatch”>
<match url=”^snatch-([0-9]+).html” />
<action type=”Rewrite” url=”snatch.php?id={R:1}” />
</rule>
<rule name=”group”>
<match url=”^group_buy-([0-9]+).html” />
<action type=”Rewrite” url=”group_buy.php?act=view&id={R:1}” />
</rule>
<rule name=”auction”>
<match url=”^auction-([0-9]+).html” />
<action type=”Rewrite” url=”auction.php?act=view&id={R:1}” />
</rule>
<rule name=”exchange 0″>
<match url=”^exchange-id([0-9]+)(.*).html” />
<action type=”Rewrite” url=”exchange.php?id={R:1}&act=view” />
</rule>
<rule name=”exchange 1″>
<match url=”^exchange-([0-9]+)-min([0-9]+)-max([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*).html” />
<action type=”Rewrite” url=”exchange.php?cat_id={R:1}&integral_min={R:2}&integral_max={R:3}&page={R:4}&sort={R:5}&order={R:6}” />
</rule>
<rule name=”exchange 2″>
<match url=”^exchange-([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*).html” />
<action type=”Rewrite” url=”exchange.php?cat_id={R:1}&page={R:2}&sort={R:3}&order={R:4}” />
</rule>
<rule name=”exchange 3″>
<match url=”^exchange-([0-9]+)-([0-9]+)(.*).html” />
<action type=”Rewrite” url=”exchange.php?cat_id={R:1}&page={R:2}” />
</rule>
<rule name=”exchange 4″>
<match url=”^exchange-([0-9]+)(.*).html” />
<action type=”Rewrite” url=”exchange.php?cat_id={R:1}” />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>

引文地址:http://chuo.in/?p=98

原创文章,转载请注明: 转载自CSS ARTIST-前端开发生活日志

本文链接地址: ecshop在Win2008IIS7.5下可用的伪静态规则

回复 (0) to ecshop在Win2008IIS7.5下可用的伪静态规则

› 尚无评论。

发表评论 修改评论取消编辑

允许使用的标签 - 您可以在评论中使用如下的 HTML 标签以及属性。

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

 :wink:  :-|  :-x  :twisted:  :)  8-O  :(  :roll:  :-P  :oops:  :-o  :mrgreen:  :lol:  :idea:  :-D  :evil:  :cry:  8-)  :arrow:  :-?  :?:  :!: