鍦↖IS鐨勪吉闈欐佽鍒欎腑锛寋R:0} 鍜 {R:1} 鏄敤浜庡紩鐢ㄥ尮閰嶅埌鐨刄RL妯″紡涓殑鎹曡幏缁勩

鍏蜂綋鏉ヨ锛

{R:0} 浠h〃鏁翠釜URL妯″紡鍖归厤鐨勫唴瀹广
{R:1} 浠h〃绗竴涓崟鑾风粍鍖归厤鐨勫唴瀹广
渚嬪锛屽鏋滀綘鏈変竴涓吉闈欐佽鍒欏涓嬶細

bash
URL閲嶅啓瑙勫垯: ^products/([0-9]+)/([a-zA-Z]+)$ /product.aspx?id={R:1}&name={R:2}
瀵逛簬URL products/123/shoes锛岃繖涓鍒欎細灏哢RL閲嶅啓涓 /product.aspx?id=123&name=shoes銆

{R:0} 浼氬尮閰嶅埌 products/123/shoes
{R:1} 浼氬尮閰嶅埌 123
{R:2} 浼氬尮閰嶅埌 shoes
杩欐牱锛屼綘灏卞彲浠ョ伒娲诲湴灏嗕笉鍚岀殑閮ㄥ垎閲嶅啓鍒扮洰鏍嘦RL鐨勪笉鍚岄儴鍒嗐

浠ヤ笂灏辨槸IIS web.config浼潤鎬佷腑{R:0}锛寋R:1}鏄粈涔堟剰鎬濈殑璇︾粏鍐呭锛屾洿澶氫俊鎭鍏虫敞OD浜戝叾瀹冪浉鍏虫枃绔狅紒



鏈枃URL锛http://www.odweb.cn/news_show.html?id=232