使用網址轉換模組, 於 IIS 7 的設定
Using the URL Rewrite Module
http://learn.iis.net/page.aspx/460/using-the-url-rewrite-module/
Creating Rewrite Rules for the URL Rewrite Module
http://learn.iis.net/page.aspx/461/creating-rewrite-rules-for-the-url-rewrite-module/
快速入門
下載 URL Rewrite module
( URL Rewrite http://www.iis.net/downloads/default.aspx?tabid=34&g=6&i=1691 )
x86 version of the URL Rewrite module http://go.microsoft.com/?linkid=9722533
x64 version of the URL Rewrite module http://go.microsoft.com/?linkid=9722532
下載之後直接安裝好即可
範例: http://localhost/urlx/Default/123/test/
轉換至 http://localhost/urlx/Default.aspx?id=123&title=test
請先準備好你的 default.aspx
開啟 IIS 7 管理員, 點選至你要設定的虛擬目錄,
點兩下 URL Rewrite 項目, Add Rule(s)...
現在要來新增一個轉換網址的規則, 選擇 Blank rule, 確定
Name 請輸入這個轉換規則的名稱, 例如: Default.aspx
Pattern 請輸入轉換規則的定義, 以 regular expression 表示,
例: ^Default/([0-9]+)/([_0-9a-z-]+)
Rewrite ULR 請輸入轉換之後的網址,
此例中我們是要轉換給 default.aspx 處理,
請輸入: Default.aspx?ID={R:1}&title={R:2}
這個轉換規則的意思即是,
把網址 http://localhost/urlx/ 之後,
符合 Default/123/test 這種樣子的網址,
轉換為 Default.aspx?id=123&title=test
給 Default.aspx 這個 asp.net 網頁處理
2010-12-22
URL Rewriting, 使用網址轉換模組, 於 IIS 7 的設定
訂閱:
張貼留言 (Atom)
熱門文章
-
使用網址轉換模組, 於 IIS 7 的設定 Using the URL Rewrite Module http://learn.iis.net/page.aspx/460/using-the-url-rewrite-module/ Creating Rewrite Rules f...
-
SQL SELECT 輸出至文字檔案 設定 SQL Server 的介面區組態, 啟用 xp_cmdshell ( 請注意啟用 xp_cmdshell 會讓 sql injection 有機會寫入檔案至 server 上 ) 執行 SQL EXEC xp_cmdshell...
-
http://azo-freeware.blogspot.com/2008/12/potplayer-1317106.html 韓系影片播放軟體 - PotPlayer,是KMPlayer出售後,原著作者進入Daum公司重新打造的全新極簡風格力作,其外觀理所當然的與KMPlaye...
-
test
-
台日美三國醫生在國際研討會中碰面,三個人開始吹噓自己國家醫術的高明。 日本醫生說,十年前我們有個年輕人車禍手指撞斷了,送到醫院手術後,今年他得到國際鋼琴大賽首獎。 美國醫生說,十年前我們有個年輕人車禍腳撞斷了,送到醫院手術後,上次奧運會他是一百公尺短跑冠軍。 台灣醫生聽了在旁邊冷...
沒有留言:
張貼留言