Friday, 1 May 2015

HTML Tutorial 30

HTML Uniform Resource Locators


A URL is another word for a web address.
A URL can be composed of words, or an Internet Protocol (IP) address (192.68.20.50).
Most people enter the name when surfing, because names are easier to remember than numbers.

URL - Uniform Resource Locator

Web browsers request pages from web servers by using a URL.
When you click on a link in an HTML page, an underlying <a> tag points to an address on the web.
A Uniform Resource Locator (URL) is used to address a document (or other data) on the web.

Example

scheme://host.domain:port/path/filename
Explanation:
  • scheme - defines the type of Internet service (most common is http)
  • host - defines the domain host (default host for http is www)
  • domain - defines the Internet domain name (myblog.com)
  • port - defines the port number at the host (default for http is 80)
  • path - defines a path at the server (If omitted: the root directory of the site)
  • filename - defines the name of a document or resource

Common URL Schemes

The table below lists some common schemes:
SchemeShort forUsed for
httpHyperText Transfer ProtocolCommon web pages. Not encrypted
httpsSecure HyperText Transfer ProtocolSecure web pages. Encrypted
ftpFile Transfer ProtocolDownloading or uploading files
fileA file on your computer

URL Encoding

URLs can only be sent over the Internet using the ASCII character-set.
Since URLs often contain characters outside the ASCII set, the URL has to be converted into ASCII.
URL encoding converts characters into a format that can be transmitted over the Internet.
URL encoding replaces non ASCII characters with a "%" followed by hexadecimal digits.
URLs cannot contain spaces. URL encoding normally replaces a space with a plus (+) sign, or %20.

Try It Yourself


If you click "Submit", the browser will URL encode the input before it is sent to the server.
A page at the server will display the received input.
Try some other input and click Submit again.

Need help? Try KimmyJusTips! 

ASCII Encoding Examples

Your browser will encode input, according to the character-set used in your page.
The default character-set in HTML5 is UTF-8.
CharacterFrom Windows-1252From UTF-8
€%80%E2%82%AC
£%A3%C2%A3
©%A9%C2%A9
®%AE%C2%AE
À%C0%C3%80
Á%C1%C3%81
Â%C2%C3%82
Ã%C3%C3%83
Ä%C4%C3%84
Å%C5%C3%85

No comments:

Post a Comment