ecmall iis 伪静态规则

2014-6-12 晦涩sunshine PHP学习笔记

        貌似按照官方的伪静态操作方法在iis不起作用,于是对官方伪静态规则进行了修改,问题得到解决。

官方给的伪静态规则如下:

-----内容开始,不要复制本行-----
[ISAPI_Rewrite]

# 为了确保重写规则不影响服务器上的其他站点
# 请将下面的语句前的#号去掉,并将(?:www\.)?site1\.com改为商店所在域名

#RewriteCond %{HTTP:Host} (?:www\.)?site1\.com

RewriteRule ^goods/([0-9]+)/?$ index.php?app=goods&id=$1 [I]
RewriteRule ^goods/([0-9]+)/([^/]+)/?$ index.php?app=goods&id=$1&act=$2 [I]
RewriteRule ^goods/([0-9]+)/([^/]+)/page_([^/]+)/?$ index.php?app=goods&id=$1&act=$2&page=$3 [I]
RewriteRule ^groupbuy/([0-9]+)/?$ index.php?app=groupbuy&id=$1 [I]
RewriteRule ^category/goods/?$ index.php?app=category [I]
RewriteRule ^category/(.*)/?$ index.php?app=category&act=$1 [I]
RewriteRule ^brand/?$ index.php?app=brand [I]
RewriteRule ^article/([0-9]+).html$ index.php?app=article&act=view&article_id=$1 [I]
RewriteRule ^store/([0-9]+)/?$ index.php?app=store&id=$1 [I]
RewriteRule ^store/article/([0-9]+).html$ index.php?app=store&act=article&id=$1 [I]
RewriteRule ^store/([0-9]+)/credit/?$ index.php?app=store&id=$1&act=credit [I]
RewriteRule ^store/([0-9]+)/credit/page_([^/]+)/?$ index.php?app=store&id=$1&act=credit&page=$2 [I]
RewriteRule ^store/([0-9]+)/credit/([0-9]+)/?$ index.php?app=store&id=$1&act=credit&eval=$2 [I]
RewriteRule ^store/([0-9]+)/credit/([0-9]+)/page_([^/]+)/?$ index.php?app=store&id=$1&act=credit&eval=$2&page=$3 [I]
RewriteRule ^store/([0-9]+)/goods/?$ index.php?app=store&id=$1&act=search [I]
RewriteRule ^store/([0-9]+)/goods/page_([^/]+)/?$ index.php?app=store&id=$1&act=search&page=$2 [I]
RewriteRule ^store/([0-9]+)/category/([0-9]+)/?$ index.php?app=store&id=$1&act=search&cate_id=$2 [I]
RewriteRule ^store/([0-9]+)/category/([0-9]+)/page_([^/]+)/?$ index.php?app=store&id=$1&act=search&cate_id=$2&page=$3 [I]
RewriteRule ^store/([0-9]+)/groupbuy/?$ index.php?app=store&id=$1&act=groupbuy [I]
RewriteRule ^store/([0-9]+)/groupbuy/page_([^/]+)/?$ index.php?app=store&id=$1&act=groupbuy&page=$2 [I]
-----内容结束,不要复制本行-----
修改后的伪静态规则:

[ISAPI_Rewrite]

# 3600 = 1 hour
CacheClockRate 3600

RepeatLimit 32


#商品详情
RewriteRule /goods/([0-9]+)/?$ /index\.php\?app=goods&id=$1 [L]
RewriteRule /goods/([0-9]+)/([^/]+)/?$ /index\.php\?app=goods&id=$1&act=$2 [L]
RewriteRule /goods/([0-9]+)/([^/]+)/page_([^/]+)/?$ /index.php\?app=goods&id=$1&act=$2&page=$3 [L]
RewriteRule /groupbuy/([0-9]+)/?$ /index\.php\?app=groupbuy&id=$1 [L]

#分类
RewriteRule /category/goods/?$ /index\.php\?app=category [L]
RewriteRule /category/(.*)/?$ /index\.php\?app=category&act=$1 [L]

#品牌
RewriteRule /brand/?$ /index\.php\?app=brand [L]

#文章
RewriteRule /article/([0-9]+).html$ /index\.php\?app=article&act=view&article_id=$1 [L]

#店铺页面
RewriteRule /store/([0-9]+)/?$ /index\.php\?app=store&id=$1 [L]
RewriteRule /store/article/([0-9]+).html$ /index\.php\?app=store&act=article&id=$1 [L]
RewriteRule /store/([0-9]+)/credit/?$ /index\.php\?app=store&id=$1&act=credit [L]
RewriteRule /store/([0-9]+)/credit/page_([^/]+)/?$ /index\.php\?app=store&id=$1&act=credit&page=$2 [L]
RewriteRule /store/([0-9]+)/credit/([0-9]+)/?$ /index\.php\?app=store&id=$1&act=credit&eval=$2 [L]
RewriteRule /store/([0-9]+)/credit/([0-9]+)/page_([^/]+)/?$ /index\.php\?app=store&id=$1&act=credit&eval=$2&page=$3 [L]
RewriteRule /store/([0-9]+)/goods/?$ /index\.php\?app=store&id=$1&act=search [L]
RewriteRule /store/([0-9]+)/goods/page_([^/]+)/?$ /index\.php\?app=store&id=$1&act=search&page=$2 [L]
RewriteRule /store/([0-9]+)/category/([0-9]+)/?$ /index\.php\?app=store&id=$1&act=search&cate_id=$2 [L]
RewriteRule /store/([0-9]+)/category/([0-9]+)/page_([^/]+)/?$ /index\.php\?app=store&id=$1&act=search&cate_id=$2&page=$3 [L]
RewriteRule /store/([0-9]+)/groupbuy/?$ /index\.php\?app=store&id=$1&act=groupbuy [L]
RewriteRule /store/([0-9]+)/groupbuy/page_([^/]+)/?$ /index\.php\?app=store&id=$1&act=groupbuy&page=$2 [L]
其他步骤请参考官方文档!

标签: ecmall 伪静态 iis

评论:

屠龙
2014-06-14 20:40
看起来有点复杂,不明白是什么意思。

发表评论:

Powered by emlog sitemap