商会资讯

 找回密码
 立即注册

QQ登录

只需一步,快速开始

用新浪微博连接

一步搞定

搜索
热搜: 活动 交友 discuz

IIS7.0下ecshop通过web.config文件开启伪静态规则

已有 3599 次阅读2012-10-15 11:53 |个人分类:IIS|

前提条件是你的空间支持iis7.0 url rewrite,你可以将下面的伪静态规则添加到web.config文件里面来实现伪静态:<?xml version="1.0" encoding="utf-8"?>
< configuration>
<system.webserver>
< rewrite>
<rules>
<rule name="1" stopprocessing="true">
<match url="^index\.html$" ignorecase="true" />
<action type="rewrite" url="index.php" />
</rule>
<rule name="2" stopprocessing="true">
<match url="^category$" ignorecase="false" />
<action type="rewrite" url="index.php" />
</rule>
<!--# access any object by its numeric identifier-->
<rule name="3" stopprocessing="true">
<match url="^feed-c(+)\.xml$" ignorecase="false" />
<action type="rewrite" url="feed.php\?cat={r:1}" appendquerystring="false" />
</rule>
<rule name="4" stopprocessing="true">
<match url="^feed-b(+)\.xml$" ignorecase="false" />
<action type="rewrite" url="feed.php\?brand={r:1}" appendquerystring="false" />
</rule>
<rule name="5" stopprocessing="true">
<match url="^feed-type([^-]+)\.xml$" ignorecase="false" />
<action type="rewrite" url="feed.php\?type={r:1}" appendquerystring="false" />
</rule>
<rule name="6" stopprocessing="true">
<match url="^feed\.xml$" ignorecase="false" />
<action type="rewrite" url="feed.php" />
</rule>
<rule name="7" stopprocessing="true">
<match url="^category-(+)-b(+)-min(+)-max(+)-attr([^-]*)-(+)-(.+)-(+)(.*)\.html$" ignorecase="false" />
<action type="rewrite" url="category.php\?id={r:1}&amp;brand={r:2}&amp;price_min={r:3}&amp;price_max={r:4}&amp;filter_attr={r:5}&amp;page={r:6}&amp;sort={r:7}&amp;order={r:8}" appendquerystring="true" />
</rule>
<rule name="8" stopprocessing="true">
<match url="^category-(+)-b(+)-min(+)-max(+)-attr([^-]*)(.*)\.html$" ignorecase="false" />
<action type="rewrite" url="category.php\?id={r:1}&amp;brand={r:2}&amp;price_min={r:3}&amp;price_max={r:4}&amp;filter_attr={r:5}" appendquerystring="true" />
</rule>
<rule name="9" stopprocessing="true">
<match url="^category-(+)-b(+)-(+)-(.+)-(+)(.*)\.html$" ignorecase="false" />
<action type="rewrite" url="category.php\?id={r:1}&amp;brand={r:2}&amp;page={r:3}&amp;sort={r:4}&amp;order={r:5}" appendquerystring="true" />
</rule>
<rule name="10" stopprocessing="true">
<match url="^category-(+)-b(+)-(+)(.*)\.html$" ignorecase="false" />
<action type="rewrite" url="category.php\?id={r:1}&amp;brand={r:2}&amp;page={r:3}" appendquerystring="true" />
</rule>
<rule name="11" stopprocessing="true">
<match url="^category-(+)-b(+)(.*)\.html$" ignorecase="false" />
<action type="rewrite" url="category.php\?id={r:1}&amp;brand={r:2}" appendquerystring="true" />
</rule>
<rule name="12" stopprocessing="true">
<match url="^category-(+)(.*)\.html$" ignorecase="false" />
<action type="rewrite" url="category.php\?id={r:1}" appendquerystring="true" />
</rule>
<rule name="13" stopprocessing="true">
<match url="^goods-(+)(.*)\.html$" ignorecase="false" />
<action type="rewrite" url="goods.php\?id={r:1}" appendquerystring="true" />
</rule>
<rule name="14" stopprocessing="true">
<match url="^article_cat-(+)-(+)-(.+)-(+)(.*)\.html$" ignorecase="false" />
<action type="rewrite" url="article_cat.php\?id={r:1}&amp;page={r:2}&amp;sort={r:3}&amp;order={r:4}" appendquerystring="true" />
</rule>
<rule name="15" stopprocessing="true">
<match url="^article_cat-(+)-(+)-(.+)(.*)\.html$" ignorecase="false" />
<action type="rewrite" url="article_cat.php\?id={r:1}&amp;page={r:2}&amp;keywords={r:3}" appendquerystring="true" />
</rule>
<rule name="16" stopprocessing="true">
<match url="^article_cat-(+)-(+)(.*)\.html$" ignorecase="false" />
<action type="rewrite" url="article_cat.php\?id={r:1}&amp;page={r:2}" appendquerystring="true" />
</rule>
<rule name="17" stopprocessing="true">
<match url="^article_cat-(+)(.*)\.html$" ignorecase="false" />
<action type="rewrite" url="article_cat.php\?id={r:1}" appendquerystring="true" />
</rule>
<rule name="18" stopprocessing="true">
<match url="^article-(+)(.*)\.html$" ignorecase="false" />
<action type="rewrite" url="article.php\?id={r:1}" appendquerystring="true" />
</rule>
<rule name="19" stopprocessing="true">
<match url="^brand-(+)-c(+)-(+)-(.+)-(+)\.html" ignorecase="false" />
<action type="rewrite" url="brand.php\?id={r:1}&amp;cat={r:2}&amp;page={r:3}&amp;sort={r:4}&amp;order={r:5}" appendquerystring="true" />
</rule>
<rule name="20" stopprocessing="true">
<match url="^brand-(+)-c(+)-(+)(.*)\.html" ignorecase="false" />
<action type="rewrite" url="brand.php\?id={r:1}&amp;cat={r:2}&amp;page={r:3}" appendquerystring="true" />
</rule>
<rule name="21" stopprocessing="true">
<match url="^brand-(+)-c(+)(.*)\.html" ignorecase="false" />
<action type="rewrite" url="brand.php\?id={r:1}&amp;cat={r:2}" appendquerystring="true" />
</rule>
<rule name="22" stopprocessing="true">
<match url="^brand-(+)(.*)\.html" ignorecase="false" />
<action type="rewrite" url="brand.php\?id={r:1}" appendquerystring="true" />
</rule>
<rule name="23" stopprocessing="true">
<match url="^tag-(.*)\.html" ignorecase="false" />
<action type="rewrite" url="search.php\?keywords={r:1}" appendquerystring="true" />
</rule>
<rule name="24" stopprocessing="true">
<match url="^snatch-(+)\.html$" ignorecase="false" />
<action type="rewrite" url="snatch.php\?id={r:1}" appendquerystring="true" />
</rule>
<rule name="25" stopprocessing="true">
<match url="^group_buy-(+)\.html$" ignorecase="false" />
<action type="rewrite" url="group_buy.php\?act=view&amp;id={r:1}" appendquerystring="true" />
</rule>
<rule name="26" stopprocessing="true">
<match url="^auction-(+)\.html$" ignorecase="false" />
<action type="rewrite" url="auction.php\?act=view&amp;id={r:1}" appendquerystring="true" />
</rule>
<rule name="27" stopprocessing="true">
<match url="^exchange-id(+)(.*)\.html$" ignorecase="false" />
<action type="rewrite" url="exchange.php\?id={r:1}&amp;act=view" appendquerystring="true" />
</rule>
<rule name="28" stopprocessing="true">
<match url="^exchange-(+)-min(+)-max(+)-(+)-(.+)-(+)(.*)\.html$" ignorecase="false" />
<action type="rewrite" url="exchange.php\?cat_id={r:1}&amp;integral_min={r:2}&amp;integral_max={r:3}&amp;page={r:4}&amp;sort={r:5}&amp;order={r:6}" appendquerystring="true" />
</rule>
<rule name="29" stopprocessing="true">
<match url="^exchange-(+)-(+)-(.+)-(+)(.*)\.html$" ignorecase="false" />
<action type="rewrite" url="exchange.php\?cat_id={r:1}&amp;page={r:2}&amp;sort={r:3}&amp;order={r:4}" appendquerystring="true" />
</rule>
<rule name="30" stopprocessing="true">
<match url="^exchange-(+)-(+)(.*)\.html$" ignorecase="false" />
<action type="rewrite" url="exchange.php\?cat_id={r:1}&amp;page={r:2}" appendquerystring="true" />
</rule>
<rule name="31" stopprocessing="true">
<match url="^exchange-(+)(.*)\.html$" ignorecase="false" />
<action type="rewrite" url="exchange.php\?cat_id={r:1}" appendquerystring="true" />
</rule>
</rules>
</rewrite>
</system.webserver>
< /configuration>
上面给出的是一个完整的web.config文件的代码,如果你的网站根目录里面已经有web.config文件,只需复制里面的规则部分(<rules>和</rules>之间的内容),然后添加到你的web.config文件里面。

然后进ecshop后台,在 商店设置、基本设置的“url重写”栏目下,选择“简单重写”,然后更新即可。
收藏 分享邀请 转发到微博 举报

评论 (0 个评论)

facelist doodle 涂鸦板

您需要登录后才可以评论 登录 | 立即注册

回顶部