最全的伪静态规则和设置方法

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

最近陆续有很多站长过来询问伪静态的问题,现就分享下目前网上流行的各种程序在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 3.1.0.56

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\.ph p\?$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

下面就需要配置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=$1&page=$2 [I]

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 /goods\.php\?id=$1 [I]

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\.p hp\?$2&$4

相关文档
最新文档