π HTML URL
β What is URL?
β’ URL stands for Uniform Resource Locator.
β’ A URL is another word for a web address.
β’ A URL can be composed of words (e.g. example.com/index.html) or an Internet Protocol (IP) address (e.g. 192.68.20.50).
β’ Web browsers request pages from web servers by using a URL.
β’ A Uniform Resource Locator (URL) is used to address a document (or other data) on the web.
π URL Syntax
β Explanation-
β’ scheme - defines the type of Internet service (most common is http or https)
β’ prefix - defines a domain prefix (default for http is www)
β’ domain - defines the Internet domain name (like example.com/index.html)
β’ 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
π Different URL Schemes
β The following table lists some different schemes used in URL with their uses.
β’ Scheme: http - HyperText Transfer Protocol
β’ Used for - Common web pages. Not encrypted.
β’ Scheme: https - Secure HyperText Transfer Protocol
β’ Used for - Secure web pages. Encrypted
β’ Scheme: ftp - File Transfer Protocol
β’ Used for - Downloading or uploading files
β’ Scheme: file
β’ Used for - A file on your computer
π URL Encoding
β URLs can only be sent over the Internet using the ASCII character-set.
β If a URL contains characters outside the ASCII set, the URL has to be converted.
β URL encoding converts non-ASCII 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.
π URL Encoding Functions
β In JavaScript, PHP, and ASP there are functions that can be used to URL encode a string.
β PHP has the rawurlencode() function, and ASP has the Server.URLEncode() function.
β In JavaScript you can use the encodeURIComponent() function.
Thanks for reading this thread β€οΈ
If you like it , make sure you:
π· Like the tweet
π· Retweet the first tweet β‘
For more content , follow:
@MrunayU