偽靜態(tài)在iis下的規(guī)則和設(shè)置方法_Web服務(wù)器教程
最近陸續(xù)有很多站長(zhǎng)過(guò)來(lái)詢問(wèn)偽靜態(tài)的問(wèn)題,現(xiàn)就分享下目前網(wǎng)上流行的各種程序在iis下的規(guī)則和設(shè)置方法:
shopex4.8
下載3.0的免費(fèi)Rewrite組件 http://www.helicontech.com/download/isapi_rewrite/ISAPI_Rewrite3_0056_Lite.msi
按照默認(rèn)路徑安裝后,打開(kāi)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=$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加載組件了:
打開(kāi)iis,右鍵你的站點(diǎn)屬性--ISAPI 篩選器--添加--篩選器名稱是ISAPI_Rewrite3 --可執(zhí)行文件就是ISAPI_Rewrite.dll的路徑,比如C:\Program Files\Helicon\ISAPI_Rewrite3\ISAPI_Rewrite.dll
最后重啟iis
當(dāng)然你可以把ISAPI_Rewrite3目錄放入站點(diǎn)根目錄下,但記得要給一個(gè)users和"network service"的讀權(quán)限。
注意:有些服務(wù)器或者vps有做權(quán)限的,安裝后httpd.conf可能只有everyone和system的權(quán)限,如果修改不了文件就添加一個(gè)administrator的權(quán)限。
shopex4.7
免費(fèi)的rewrite2.0組件下載地址 http://www.isapirewrite.com/download/isapi_rwl_x86_0072.msi
安裝后添加如下規(guī)則
規(guī)則如下:
[ISAPI_Rewrite]
# 3600 = 1 hour
CacheClockRate 3600
RepeatLimit 32
#首頁(yè)
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
#會(huì)員中心
RewriteRule /member.html /index.php\?gOo=member_home.dwt
#幫助中心與常見(jiàn)問(wèn)題
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
#購(gòu)買(mǎi)流程
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
#用戶注冊(cè)
RewriteRule /register.html /index.php\?gOo=register_1.dwt
#忘記密碼
RewriteRule /lostpass.html /index.php\?gOo=forget.dwt
#商品詳細(xì)頁(yè)
RewriteRule /product/([0-9]+).html /index.php\?gOo=goods_details.dwt&goodsid=$1
RewriteRule /product_([0-9]+).html /index.php\?gOo=goods_details.dwt&goodsid=$1
RewriteRule /([0-9]+)_([^.]*).html /index.php\?gOo=goods_details.dwt&goodsid=$1
#新聞詳細(xì)頁(yè)
RewriteRule /article_([0-9]+).html /index.php\?gOo=help_details.dwt&articleid=$1
RewriteRule /message_([0-9]+).html /index.php\?gOo=article_details.dwt&articleid=$1
#分類詳細(xì)列表
RewriteRule /catalog_([0-9]+).html /index.php\?gOo=goods_search_list.dwt&gcat=$1
RewriteRule /catalog_([0-9]+)_([0-9]+).html /index.php\?gOo=goods_search_list.dwt&gcat=$1&p=$2
#收藏商品
RewriteRule /addtofavorites_([0-9]+).html /index.php\?gOo=addmembergoods.do&goodsid=$1
#首頁(yè)上的最新,推薦,特價(jià)商品
RewriteRule /list_([a-zA-Z]+).html /index.php\?gOo=goods_search_list.dwt>ype=$1
RewriteRule /list_([a-zA-Z]+)_([0-9]+).html /index.php\?gOo=goods_search_list.dwt>ype=$1&p=$2
下面就需要配置iis為shopex4.7加載組件了,方法類似shopex4.8:
打開(kāi)iis,右鍵你的站點(diǎn)屬性--ISAPI 篩選器--添加--篩選器名稱是Rewrite --可執(zhí)行文件就是Rewrite.dll的路徑,比如E:\home\LocalUser\rewrite\Rewrite.dll
最后重啟iis
rewrite.dll以及規(guī)則可以放入任何一個(gè)目錄,但記得要給該目錄一個(gè)users的讀權(quán)限。
以上就是shopex4.8和shopex4.7的規(guī)則以及配置方法。如果iis內(nèi)有其它程序比如discuz、phpwind之類的,就可能會(huì)相互有影響,那么就打開(kāi)iis,
右鍵網(wǎng)站屬性--ISAPI 篩選器--刪除isapi_rewrite這項(xiàng),因?yàn)檫@里是對(duì)整個(gè)iis進(jìn)行設(shè)置的,會(huì)造成其它程序的沖突。
注意isapi_rewrite3.0和isapi_rewrite2.0不能混用。
因?yàn)槠鶈?wèn)題,現(xiàn)在再把shopex4.7/4.8、discuz6/NT2.5、ecshop、dvbbs、phpwind、wordpress、Discuz6+ecshop等偽靜態(tài)規(guī)則和組件打包進(jìn)行下載。
以上設(shè)置都是針對(duì)租用了獨(dú)立服務(wù)器和vps的,在使用虛擬主機(jī)的就不用看了,因?yàn)樽鳛榉⻊?wù)商是應(yīng)該做好了的,但目前還沒(méi)有出現(xiàn)對(duì)所有流行程序都支持的吧。
- 推薦!各類建站程序偽靜態(tài)規(guī)則代碼
- 詳細(xì)的DedeCMS(織夢(mèng))目錄權(quán)限安全設(shè)置教程
- iis安全設(shè)置全方位教程
- 巧妙出招致勝服務(wù)器管理
- Win Server 2003個(gè)人網(wǎng)絡(luò)服務(wù)器安全攻略
- Windows 2003校園Web服務(wù)器常見(jiàn)問(wèn)題
- 清除IIS配置文件后門(mén)隱患
- Web服務(wù)器和應(yīng)用程序服務(wù)器有什么區(qū)別
- 虛擬主機(jī)下asp.net 2.0的導(dǎo)航控件treeview,menu等出錯(cuò)
- IIS6.0服務(wù)器架站無(wú)法訪問(wèn)解決方案總結(jié)
- 圖解支持多語(yǔ)言環(huán)境的IIS服務(wù)器配置
- IIS服務(wù)器排錯(cuò)指南及錯(cuò)誤代碼大全
Web服務(wù)器教程Rss訂閱服務(wù)器教程搜索
Web服務(wù)器教程推薦
- 分析:中國(guó)web2.0不推特色服務(wù)將面臨崩潰
- 通過(guò)設(shè)置Web服務(wù)器日志讓IIS更安全
- 如何測(cè)試 Macintosh Web 服務(wù)器
- LiteSpeed服務(wù)器用htaccess的防盜鏈代碼
- Nginx(PHP/fastcgi)的PATH_INFO的問(wèn)題
- 網(wǎng)絡(luò)安全之CMD下的網(wǎng)絡(luò)安全配置
- 用X-Space建造自己的Web2.0文件下載站
- 為應(yīng)用程序池 ''DefaultAppPool'' 提供服務(wù)的進(jìn)程關(guān)閉時(shí)間超過(guò)了限制
- 如何通過(guò)Apache 的mod_rewrite實(shí)現(xiàn)偽靜態(tài)
- More Effective C++:通過(guò)引用捕獲異常
猜你也喜歡看這些
- shtml用include加載文件,apache開(kāi)啟SSI,及shtml壓縮
- 避免危害DNS服務(wù)器安全部署的七宗罪
- 如何監(jiān)控HP服務(wù)器硬件狀態(tài)
- 服務(wù)器管理最容易犯的十大錯(cuò)誤
- DELL服務(wù)器利用OMSA修改BIOS設(shè)置
- redis memcache 性能比較
- 在多臺(tái)服務(wù)器上簡(jiǎn)單實(shí)現(xiàn)Redis的數(shù)據(jù)主從復(fù)制
- win2003服務(wù)器中IIS的ASP.NET安全權(quán)限設(shè)置
- apache防盜鏈的兩種實(shí)現(xiàn)方法
- 虛擬主機(jī)如何解決電信網(wǎng)通間互聯(lián)互通
- 相關(guān)鏈接:
- 教程說(shuō)明:
Web服務(wù)器教程-偽靜態(tài)在iis下的規(guī)則和設(shè)置方法。