URL ÊÇÒ»¸öÍøÒ³µØÖ·¡£
URL ¿ÉÒÔÓÉ×Öĸ×é³É£¬Èç "W3CSchools.cc"£¬»ò»¥ÁªÍøÐÒ飨IP£©µØÖ·£º 192.68.20.50¡£´ó¶àÊýÈ˽øÈëÍøվʹÓÃÍøÕ¾ÓòÃûÀ´·ÃÎÊ£¬ÒòΪÃû×Ö±ÈÊý×Ö¸üÈÝÒ×¼Çס¡£
Web ä¯ÀÀÆ÷ͨ¹ý URL ´Ó Web ·þÎñÆ÷ÇëÇóÒ³Ãæ¡£
µ±Äúµã»÷ HTML Ò³ÃæÖеÄij¸öÁ´½Óʱ£¬¶ÔÓ¦µÄ <a> ±êÇ©Ö¸ÏòÍòάÍøÉϵÄÒ»¸öµØÖ·¡£
Ò»¸öͳһ×ÊÔ´¶¨Î»Æ÷ (URL) ÓÃÓÚ¶¨Î»ÍòάÍøÉϵÄÎĵµ¡£
Ò»¸öÍøÒ³µØַʵÀý: //www.w3cschool.cn/html/html-tutorial.html Óï·¨¹æÔò:
scheme://host.domain:port/path/filename
˵Ã÷:
scheme - ¶¨ÒåÒòÌØÍø·þÎñµÄÀàÐÍ¡£×î³£¼ûµÄÀàÐÍÊÇ http
host - ¶¨ÒåÓòÖ÷»ú£¨http µÄĬÈÏÖ÷»úÊÇ www £©
domain - ¶¨ÒåÒòÌØÍøÓòÃû£¬±ÈÈç w3cschool.cn
:port - ¶¨ÒåÖ÷»úÉϵĶ˿ںţ¨http µÄĬÈ϶˿ںÅÊÇ 80 £©
path - ¶¨Òå·þÎñÆ÷ÉϵÄ·¾¶£¨Èç¹ûÊ¡ÂÔ£¬ÔòÎĵµ±ØÐëλÓÚÍøÕ¾µÄ¸ùĿ¼ÖУ©¡£
filename - ¶¨ÒåÎĵµ / ×ÊÔ´µÄÃû³Æ
ÒÔÏÂÊÇһЩ URL scheme£º
Scheme | ·ÃÎÊ | ÓÃÓÚ... |
---|---|---|
http | ³¬Îı¾´«ÊäÐÒé | ÒÔ http:// ¿ªÍ·µÄÆÕͨÍøÒ³¡£²»¼ÓÃÜ¡£ |
https | °²È«³¬Îı¾´«ÊäÐÒé | °²È«ÍøÒ³£¬¼ÓÃÜËùÓÐÐÅÏ¢½»»»¡£ |
ftp | Îļþ´«ÊäÐÒé | ÓÃÓÚ½«ÎļþÏÂÔØ»òÉÏ´«ÖÁÍøÕ¾¡£ |
file | Äú¼ÆËã»úÉϵÄÎļþ¡£ |
URL Ö»ÄÜʹÓà ASCII ×Ö·û¼¯¡£
URL ±àÂë»á½«×Ö·ûת»»Îª¿Éͨ¹ýÒòÌØÍø´«ÊäµÄ¸ñʽ¡£À´Í¨¹ýÒòÌØÍø½øÐз¢ËÍ£¬ÓÉÓÚ URL ³£³£»á°üº¬ ASCII ¼¯ºÏÖ®ÍâµÄ×Ö·û£¬URL ±ØÐëת»»ÎªÓÐЧµÄ ASCII ¸ñʽ¡£
URL ±àÂëʹÓà "%" Æäºó¸úËæÁ½Î»µÄÊ®Áù½øÖÆÊýÀ´Ìæ»»·Ç ASCII ×Ö·û¡£
URL ²»ÄÜ°üº¬¿Õ¸ñ¡£URL ±àÂëͨ³£Ê¹Óà + À´Ìæ»»¿Õ¸ñ¡£
Èç¹ûÄúµã»÷"Ìá½»"°´Å¥£¬ä¯ÀÀÆ÷»áÔÚ·¢ËÍÊäÈë֮ǰ¶ÔÆä½øÐÐ URL ±àÂë¡£·þÎñÆ÷ÉϵÄÒ³Ãæ»áÏÔʾ³ö½ÓÊÕµ½µÄÊäÈë¡£
µã»÷ "³¢ÊÔÒ»ÏÂ" °´Å¥²é¿´ÔÚÏßʵÀý
Ìáʾ£ºJavaScript¡¢PHP¡¢ASP ¶¼ÌṩÁ˶Ô×Ö·û´®½øÐÐ URL ±àÂëµÄº¯Êý¡£
×Ö·û | URL ±àÂë |
---|---|
€ | %80 |
¡ê | %A3 |
? | %A9 |
? | %AE |
¨¤ | %C0 |
¨¢ | %C1 |
? | %C2 |
? | %C3 |
? | %C4 |
? | %C5 |
ÈçÐèÍêÕûµÄ URL ±àÂë²Î¿¼£¬Çë·ÃÎÊÎÒÃÇµÄ URL ±àÂë²Î¿¼Êֲᡣ