咨询热线:(86)010-5361 5789  授权查询  客服中心  帮助中心
日期:2010-05-23 分类:友邻B2B3.3专题, 用户手册 文字: [ ]

主要分为IIS服务器和Apache服务器:

# BEGIN REWRITE
ErrorDocument 404 /redirect.php?code=404
ErrorDocument 403 /redirect.php?code=403

RewriteEngine on
RewriteBase /
RewriteRule ^(.*)offer/detail/([0-9]+)\.html$ /offer/detail.php\?id=$2 [QSA]
RewriteRule ^(.*)industry/([0-9]+)/$ /special/industry.php\?id=$2 [QSA]
RewriteRule ^(.*)area/([0-9]+)/$ /special/area.php\?id=$2 [QSA]
RewriteRule ^(.*)buy/detail/([0-9]+)\.html$ /offer/detail.php\?id=$2 [QSA]
RewriteRule ^(.*)sell/detail/([0-9]+)\.html$ /offer/detail.php\?id=$2 [QSA]
RewriteRule ^(.*)product/detail/([0-9]+)\.html$ /product/content.php\?id=$2 [QSA]
RewriteRule ^(.*)news/detail/([0-9]+)\.html$ /news/detail.php\?id=$2 [QSA]
RewriteRule ^(.*)market/detail/([0-9]+)\.html$ /market/detail.php\?id=$2 [QSA]
RewriteRule ^(.*)announce/detail/([0-9]+)\.html$ /announce.php\?id=$2 [QSA]
RewriteRule ^(.*)fair/detail/([0-9]+)\.html$ /fair/detail.php\?id=$2 [QSA]
RewriteRule ^(.*)page/([a-zA-Z0-9]+)\.html$ /page.php\?name=$2 [QSA]
RewriteRule ^(.*)dict/detail/([0-9]+)\.html$ /dict/detail.php\?id=$2 [QSA]
RewriteRule ^(.*)standard/detail/([0-9]+)\.html$ /standard.php\?id=$2 [QSA]
RewriteRule ^(.*)brand/detail/([0-9]+)\.html$ /brand/detail.php\?id=$2 [QSA]
RewriteRule ^(.*)space/([a-zA-Z0-9%]+)/$ /space.php\?userid=$2 [L]
RewriteRule ^(.*)space/([a-zA-Z0-9%]+)/([a-zA-Z]+)/$ /space.php\?userid=$2&do=$3 [L]
RewriteRule ^(.*)space/([a-zA-Z0-9%]+)/([a-zA-Z]+)/type-([0-9]+)\.html$ /space.php\?userid=$2&do=$3&typeid=$4 [L]
RewriteRule ^(.*)space/([a-zA-Z0-9%]+)/([a-zA-Z]+)/list-([0-9]+)\.html$ /space.php\?userid=$2&do=$3&page=$4 [L]
RewriteRule ^(.*)space/([a-zA-Z0-9%]+)/([a-zA-Z]+)/detail-([0-9]+)\.html$ /space.php\?userid=$2&do=$3&nid=$4[L]
RewriteCond %{HTTP_HOST} ^(www.)?(?!/.|www|bbs|demo)(.*)\.yourdomain\.com$
RewriteRule ^/?$ /%{HTTP_HOST}
RewriteRule ([^.]+)\.yourdomain\.com(.*)$ /space.php\?userid=$1 [L]
RewriteRule ^(.*)space/([a-z]+)\.html$ /space.php\?userid=$1&do=$2
RewriteRule ^(.*)space/([a-z]+)/type-([0-9]+)\.html$ /space.php\?userid=$1&do=$2&typeid=$3
RewriteRule ^(.*)space/([a-z]+)/list-([0-9]+)\.html$ /space.php\?userid=$1&do=$2&page=$3
RewriteRule ^(.*)space/([a-z]+)/detail-([0-9]+)\.html$ /space.php\?userid=$1&do=$2&nid=$3

# END REWRITE

IIS服务器:

[ISAPI_Rewrite]

# 3600 = 1 hour
CacheClockRate 3600

RepeatLimit 32

# Protect httpd.ini and httpd.parse.errors files
# from accessing through HTTP
RewriteRule ^/offer/detail/([0-9]+)\.html$ /offer/detail\.php\?id=$1
RewriteRule ^/industry/([0-9]+)/$ /special/industry.php\?id=$1
RewriteRule ^/area/([0-9]+)/$ /special/area.php\?id=$1
RewriteRule ^/buy/detail/([0-9]+)\.html$ /offer/detail\.php\?id=$1
RewriteRule ^/sell/detail/([0-9]+)\.html$ /offer/detail\.php\?id=$1
RewriteRule ^/product/detail/([0-9]+)\.html$ /product/content\.php\?id=$1
RewriteRule ^/news/detail/([0-9]+)\.html$ /news/detail\.php\?id=$1
RewriteRule ^/market/detail/([0-9]+)\.html$ /market/detail\.php\?id=$1
RewriteRule ^/announce/detail/([0-9]+)\.html$ /announce\.php\?id=$1
RewriteRule ^/fair/detail/([0-9]+)\.html$ /fair/detail\.php\?id=$1
RewriteRule ^/dict/detail/([0-9]+)\.html$ /dict/detail\.php\?id=$1
RewriteRule ^/standard/detail/([0-9]+)\.html$ /standard\.php\?id=$1
RewriteRule ^/brand/detail/([0-9]+)\.html$ /brand/detail.php\?id=$1
RewriteRule ^/page/([0-9a-zA-Z]+)\.html$ /page\.php\?name=$1
RewriteRule ^/space/([0-9a-zA-Z%]+)/$ /space\.php\?userid=$1
RewriteRule ^/space/([0-9a-zA-Z%]+)/([a-zA-Z]+)/$ /space\.php\?userid=$1&do=$2
RewriteRule ^/space/([0-9a-zA-Z%]+)/([a-zA-Z]+)/type-([0-9]+)\.html$ /space\.php\?userid=$1&do=$2&typeid=$3
RewriteRule ^/space/([0-9a-zA-Z%]+)/([a-zA-Z]+)/list-([0-9]+)\.html$ /space\.php\?userid=$1&do=$2&page=$3
RewriteRule ^/space/([0-9a-zA-Z%]+)/([a-zA-Z]+)/detail-([0-9]+)\.html$ /space\.php\?userid=$1&do=$2&nid=$3 

#二级域名
RewriteCond HOST: (?!www|demo|bbs)([^.]+)\.yourdomain\.com
RewriteRule ^(.*)/$  /space.php?userid=$1
RewriteRule ^(.*)/space/([a-z]+)\.html$ /space.php?userid=$1&do=$2
RewriteRule ^(.*)/space/([a-z]+)/type-([0-9]+)\.html$ /space.php?userid=$1&do=$2&typeid=$3
RewriteRule ^(.*)/space/([a-z]+)/list-([0-9]+)\.html$ /space.php?userid=$1&do=$2&page=$3
RewriteRule ^(.*)/space/([a-z]+)/detail-([0-9]+)\.html$ /space.php?userid=$1&do=$2&nid=$3

记得把yourdomain换为你自己的域名


标签:, , , , , , ©版权所有 Ualink