2011-04-07 127 views
0

我在IIS重寫創造一個友好的URL模式IIS7 URL重寫模式查詢模板查詢字符串

我正常的URL看起來像這樣

http://localhost/orgprofile/financial.aspx?name=Test

,最初當我從可用的選項挑IIS

友好的URL與

http://localhost/orgprofile/financial/test

隨着模式

^orgprofile /金融/([^ /] +)/ $

現在我只想友好的URL更改爲

http://localhost/test/financial

所以,是的查詢字符串,然後追加金融

我可以得到這個友好的URL工作

^金融/([^ /] +)/ $

但不能得到這個工作

http://localhost/test/financial

即像

([^/] +)/?$/^ financial

回答

0

$表示查詢字符串的結尾 - 您需要在結尾保留該字符。

嘗試:(。* /)

^([^/]+)/financial/?$ 
+0

酷了工作,然後我出站規則,我不得不選擇的我最初友好的URL orgprofile /金融/微軟是^ orgprofile /金融\的.aspx \?name =([^ =&] +)$我怎樣才能編輯爲url microsoft/financial ....所以再次下降orgprofile,首先qeuerystring值然後金融 – StevieB 2011-04-07 14:55:10

+0

你可以編輯你的原始問題,試圖翻譯成什麼 - 不知道你在這裏需要什麼。如果這有助於使用正則表達式的語法:http://www.regular-expressions.info/reference.html – schizodactyl 2011-04-07 16:05:06

+0

@schizodactyl你可以發佈完整的規則,所以它會很好的幫助 – 2014-04-04 07:01:56