|
最近陸續(xù)有很多站長過來詢問偽靜態(tài)的問題,現(xiàn)就分享下目前網(wǎng)上流行的各種程序在iis下的規(guī)則和設(shè)置方法:
shopex4.8 下載3.0的免費Rewrite組件 http://www.helicontech.com/download/isapi_rewrite/ISAPI_Rewrite3_0056_Lite.msi 按照默認(rèn)路徑安裝后,打開C:\Program Files\Helicon\ISAPI_Rewrite3\httpd.conf 加入以下規(guī)則: # 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\.php\?$2&$4 RewriteRule ^(.*)/forum-([0-9]+)-([0-9]+)\.html\?*(.*)$ $1/forumdisplay\.php\?fid=$2page=$3&$4 RewriteRule ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html\?*(.*)$ $1/viewthread\.php\?tid=$2&extra=page\%3D$4page=$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 --可執(zhí)行文件就是ISAPI_Rewrite.dll的路徑,比如C:\Program Files\Helicon\ISAPI_Rewrite3\ISAPI_Rewrite.dll 最后重啟iis 當(dāng)然你可以把ISAPI_Rewrite3目錄放入站點根目錄下,但記得要給一個users和"network service"的讀權(quán)限。
注意:有些服務(wù)器或者vps有做權(quán)限的,安裝后httpd.conf可能只有everyone和system的權(quán)限,如果修改不了文件就添加一個administrator的權(quán)限。
shopex4.7 免費的rewrite2.0組件下載地址 http://www.isapirewrite.com/download/isapi_rwl_x86_0072.msi 安裝后添加如下規(guī)則 規(guī)則如下: [ISAPI_Rewrite]
# 3600 = 1 hour CacheClockRate 3600
RepeatLimit 32
#首頁 RewriteRule /index.html /index.php RewriteRule /default.html /index.php #商店公告 RewriteRule /bulletin.html /index.php\?gOo=article_list.dwt&acat=1 RewriteRule /bulletin_([0-9]+).html /index.php\?gOo=article_list.dwt&acat=1&p=$1 #商品分類 RewriteRule /catalog.html /index.php\?gOo=goods_category.dwt #全部商品 RewriteRule /list.html /index.php\?gOo=goods_search_list.dwt RewriteRule /list_([0-9]+).html /index.php\?gOo=goods_search_list.dwt&p=$1 #會員中心 RewriteRule /member.html /index.php\?gOo=member_home.dwt #幫助中心與常見問題 RewriteRule /faq.html /index.php\?gOo=help.dwt&acat=2 RewriteRule /faq_([0-9]+).html /index.php\?gOo=help.dwt&acat=2&p=$1 #安全交易 RewriteRule /safe.html /index.php\?gOo=help_safe.dwt #購買流程 RewriteRule /howtobuy.html /index.php\?gOo=help_buystep.dwt #如何付款 RewriteRule /howtopay.html /index.php\?gOo=help_send.dwt #聯(lián)系我們 RewriteRule /contactus.html /index.php\?gOo=help_contact.dwt #關(guān)于我們 RewriteRule /aboutus.html /index.php\?gOo=help_copyright.dwt #顧客留言 RewriteRule /feedback.html /index.php\?gOo=shopbbs.dwt #友情鏈接 RewriteRule /friendlink.html /index.php\?gOo=linkmore.dwt #用戶注冊 RewriteRule /register.html /index.php\?gOo=register_1.dwt |
【收藏】【打印】【進入論壇】 |
|
|
|
|
|
|
|