IIS 的 URL Rewrite 使用: 規則運算式


假設請求網址為 http://www.domain.com.tw/dir/search.aspx?user=sean

這算是自己的筆記吧! IIS 的 URL Rewrite 很好用,但想設定的人可能一頭霧水。Regular Expression 的 Pattern 是要從 http:// 開始、或是 www. 開始、或是 /dir 或 dir 都沒有說明, 每次都會忘記,所以自己做個筆記。址尾是否包含 Query String 也沒說明。


結論:

● 「模式:」填寫 Regular Expression Pattern,此例「^dir/search\.aspx$」是符合的。

● 「重寫 URL:」用 {R:1} ~ 9 當回溯值(Back-reference; 也就是 RegExp 中的括弧順序)。

● 勾「附加查詢字串」會把「?user=sean」加到「重寫 URL」尾端。

8 個回應:

chenlina 提到...

fitflops
moncler jackets
michael kors outlet
coach outlet
timberland shoes
louis vuitton outlet
mont blanc pens
ray ban sunglasses
ugg outlet
cheap uggs
chenlina20170109

Unknown 提到...

rolex replica watches
ralph lauren
coach factory outlet
gucci handbags
louis vuitton outlet
nfl jerseys
cheap uggs
sac longchamp pas cher
michael kors outlet clearance
fitflops sale clearance
20170224caiyan

Unknown 提到...

20180829xiaoke
michael kors outlet
coach outlet online
polo ralph lauren outlet online
michael kors
ralph lauren outlet
longchamp pas cher
kate spade outlet store
christian louboutin
canada goose outlet online
air jordan shoes

PENGOBATAN KISTA 提到...

Request permission, We would like to comment here with the aim of sharing some links about cyst diseases that you can click below

Cara menghilangkan kista ateroma
Pengobatan Penyakit Kista Ovarium
Biaya operasi kista ovarium
Pengobatan Kista Bartholin
Obat Kista Ganglion
Obat Kista|Cara Menghilangkan Kista Tanpa Operasi

𝖘𝖑𝖔𝖙𝖒𝖆𝖈𝖍𝖎𝖓𝖊𝖘𝖎𝖙𝖊𝖈𝖔𝖒 提到...

바카라사이트
I am definitely enjoying your website. You definitely have some great insight and great stories.

powerball365.info 提到...

I like your all post. You have done really good work. Thank you for the information you provide, it helped me a lot 파워볼 하는법

totosite365.info 提到...

Very appreciated post. Thank you for sharing this post with us. 토토

casinosite.one 提到...

What a truly magnificent post this is. Genuinely, outstanding amongst other presents I've ever seen on find in as long as I can remember. Amazing 바카라사이트

張貼留言