À´ÕÒÕâƪÎÄÕµÄ,Ó¦¸Ã¶¼ÖªµÀʲô½Ð¶þ¼¶ÓòÃû°É,·Ï»°¾Í²»ËµÁË.µ«ÊÇÌÖÂÛÇ°,ÏÈÒªÃ÷°×Ò»¸ö˼ÏëÎÊÌâ.
ºÜ¶àÅóÓÑÒ»Ö±¿¼ÂDz»Çå(ÎÒÇ°¼¸ÌìÒ²Ò»Ö±¸ã²»Ã÷°×)µÄÎÊÌâÊÇ,ÎÒ¼üÈëÒ»¸öµØÖ·ºó,ÔõôÕâ¸öurl¾Í±»ÖØдÁË?
µÚÒ»²½:ÔÚä¯ÀÀÆ÷¼üÈëÁËÒ»¸öµØÖ·,±ÈÈçhttp://love.kerry.com,µã»Ø³µºó,¶¼·¢ÉúÁËʲô?
ΪÁË°ÑÎÊÌâ¼òµ¥»¯,ÎÒÀ´ÕâÑù½âÊÍ:
µÚ¶þ²½:Ê×ÏÈ,¼üÈëµÄµØÖ·±»½âÎö,×îÖÕÀ´µ½ÁËһ̨web·þÎñÆ÷.½»¸øIIS´¦Àí.ÔÚ.netµÄÊÀ½çÖÐ,IIS»á°ÑÕâÑùµÄÇëÇóÔÙ½»¸øÒ»¸öweb´¦ÀíÆ÷ ´¦Àí,×îºó,¸Ã web´¦ÀíÆ÷ °Ñ´¦ÀíµÄ½á¹û·µ»Ø¸øä¯ÀÀÆ÷,ÏÔʾ¸øÓû§¿´.
Çë²»ÓúöÂÔÕâÑùÒ»¸öÎÊÌâ,µÚ¶þ²½µÄËùÓÐÊÂÇ鶼ÊÇÔÚ·þÎñÆ÷¶Ë×öµÄ.ÔÚÕâЩÊÂÇé½øÐеÄʱºò,Óû§¶ËµÄä¯ÀÀÆ÷ÉÏÃæµÄµØÖ·²»»á¸Ä±ä.¼´Ê¹×îºó web´¦ÀíÆ÷ °Ñ´¦Àí½á¹û·µ»ØÀ´µÄʱºò,ÉÏÃæµÄµØÖ·Ò²²»»á¸Ä±ä.
Ò»¿ªÊ¼¼üÈëµÄurl,Ö»ÊÇÆðÒ»¸öÇÃÃŵÄ×÷ÓÃ,ÃÅÇÃÍêÁË,×÷ÓþÍËã½áÊøÁË,Ö»ÓÐÄãµÄÑÛ¾¦¿ÉÒÔ¿´µ½ÄǸöµØÖ·,ä¯ÀÀÆ÷,·þÎñÆ÷µÈ¶¼²»ÖªµÀÕâ¸öµØÖ·.
È»ºóÒªÃ÷°×µÄÎÊÌâÊÇ,ËùνurlÖØд,Ò²Ö»ÊÇweb¿ª·¢ÈËÔ±ÖªµÀµÄÄÚÄ»Çé¿ö,Óû§¸ù±¾²»ÖªµÀ·¢ÉúÁËʲô,ËûÈÏΪ×Ô¼º¼üÈëµÄµØÖ·¾ÍÊÇÓ¦¸Ã³öÀ´ÆÁÄ»ÉÏÏÔʾµÄ½á¹û.Ò²¾ÍÊÇ˵,ÎÒÃÇÔÚÄ»ºó¿ØÖÆÒªÏÔʾµÄÄÚÈÝ.
½ÓÏÂÀ´Òª¿¼ÂǵÄÊÇ,ÔõôÑù¿ØÖÆÏÔʾµÄÄÚÈÝ?
´ÓÉÏÃæ˵µÄ¹ý³Ì,ºÜÃ÷ÏÔÒªÔÚ web´¦ÀíÆ÷ µÄ¹¤×÷ÕâÒ»²½¶¯ÊÖ½Å.
Ò»¸ö×î¼òµ¥µÄ¿¼ÂÇÊÇ,Óû§ÇÃÈëÁËÒ»¸ö¼òµ¥µÄ²»´øÈκβÎÊýµØÖ·, http://love.kerry.comÈ»ºóÎÒÃÇ°ÑÕâ¸öµØÖ·¸Ä³ÉÒ»¸ö·ûºÏ³ÌÐòÐèÒªµÄ´ø²ÎÊýµÄµØÖ·, http://kerry.com?lover=notus,×îºó´¦ÀíÖ®.
ËùνµÄurlÖØд,¾ÍÊÇÔÚÕâÒ»²½.
ÓÃ.netµÄÊõÓïÀ´Ëµ,ÎÒÃÇÐèÒª¸øÓ¦ÓóÌÐò×¢²áÒ»¸öhttpmodule,ÓÃÀ´´¦ÀíÌض¨µÄurl
×¢²áhttpmodule,ÔÚweb.config,
´¦Àíurl,ÔÚÎÒÃÇÌṩµÄhttpmodule³ÌÐòÖÐ
´óÌåÏ൱ÓÚÕâÑùµÄÒ»¶Î³ÌÐò
//ÓÃÎÒÃǵÄhttpmodule³ÌÐò½Ø»ñÔʼurl
String OriginalUrl=” http://love.kerry.com”;
//´¦ÀíÔʼurl,µÃµ½×îºóÐèÒªµÄurl,ֵΪhttp://kerry.com?lover=notus
String FinalUrl=Rewrite(OriginalUrl);
// contextÖØн«urlÔÚÄÚ²¿·¢Ë͸øIIS´¦Àí
context.RewritePath(FinalUrl);
½ÓÏÂÀ´,ÎÒÃÇÀ´ÊµÏÖurlÖØд.
µÚÒ»²½:È·¶¨Òª¶ÔÄÄЩurlÖ´ÐÐÖØд,¼´Öƶ¨ÖØд¹æÔò
µÚ¶þ²½:±àдhttpmodule´¦Àí³ÌÐò
µÚÈý²½:½«±àдµÄhttpmoduleÕûºÏÈëweb³ÌÐò,¿ªÊ¼¹¤×÷.
ÉÏÃæ¾ÍÊÇurlÖØдµÄ»ù±¾ÖªÊ¶,¶øÓÃurlÖØдʵÏÖ¶þ¼¶ÓòÃû,¹ý³ÌÒ»Ñù.ÒòΪÎÞÂÛÊǶþ¼¶ÓòÃû»¹ÊÇÈý¼¶ÓòÃû,¶¼ÊÇÒ»¸öurlµØÖ·.Ö»ÒªÎÒÃǽػñÕâ¸öurlµØÖ·,¾Í¿ÉÒÔÔÚ´¦ÀíµÄʱºò¶¯ÊÖ½Å.
ÔÚ¿ª·¢ÐèÒªÓû§×¢²áºó²ÅÄÜʹÓÃÌṩµÄ¸÷ÏÄܵÄÓ¦ÓóÌÐòʱ£¬ÔÚÐÂÓû§Ìá½»×¢²áÐÅÏ¢ºó£¬½Ï³£¼ûµÄ×ö·¨ÊÇÓɳÌÐòÉú³ÉËæ»úÃÜÂ룬Ȼºó·¢ËÍÃÜÂëµ½Óû§×¢²áʱÌîдµÄµç×ÓÐÅÏ䣬Óû§ÔÙÓÃÊÕµ½µÄÃÜÂëÀ´¼¤»îÆäÕÊ»§¡£
ʵÏÖASP.NETÉú³ÉËæ»úÃÜÂ빦ÄÜÊǺÜÈÝÒ׵ģ¬ÏÂÃæµÄ´úÂë¸ø³öÁËÍêÕûµÄʵÏÖ·½·¨£º
public static string MakePasswor(string ......
Ò³Ã滺´æʹÓÃOutputCacheÖ¸Áî¡£ÆäÖÐDurationºÍVaryByParamÌØÐÔÊDZØÐëµÄ¡£
Location¿ØÖÆÒ³Ã滺´æµÄλÖÃLocationº¬ÒåAnyĬÈÏÖµ¡£Òâζ×ÅÒ³ÃæµÄÊä³ö¿ÉÒÔ»º´æÔÚ¿Í»§¶Ëä¯ÀÀÆ÷£¬»º´æÔÚÈκÎ"ÏÂÓÎ"µÄ¿Í»§¶Ë£¨Èç´úÀí·þÎñÆ÷£©£¬»ò»º´æÔÚWeb·þÎñÆ÷±¾ÉíClientÖ¸Ã÷Êä³ö»º´æÖ»ÄÜ´æ´¢ÔÚ·¢³öÇëÇóµÄ¿Í»§¶Ë£¨¼´ä¯ÀÀÆ÷£©µÄ±¾µØ»º´æÖÐDownstreamÖ ......
¹ØÓÚÒ³Ãæ´«ÖµµÄ·½·¨£¬Òý·¢Á˺ܶàÌÖÂÛ¡£¿´À´ÓкܶàÈ˹Ø×¢Õâ¸ö£¬ÎÒ¾ÍÎÒ¸öÈ˹۵ã×öÁËЩ×ܽᣬϣÍû¶Ô´ó¼ÒÓÐËù°ïÖú¡£
1. ʹÓÃQueryString±äÁ¿
QueryStringÊÇÒ»Öַdz£¼òµ¥µÄ´«Öµ·½Ê½£¬Ëû¿ÉÒÔ½«´«Ë͵ÄÖµÏÔʾÔÚä¯ÀÀÆ÷µÄµØÖ·À¸ÖС£Èç¹ûÊÇ´«µÝÒ»¸ö»ò¶à¸ö°²È«ÐÔÒªÇ󲻸߻òÊǽṹ¼òµ¥µÄÊýֵʱ£¬¿ÉÒÔʹÓÃÕâ¸ö·½·¨¡£µ«ÊǶÔÓÚ´«µÝ ......