URL – Uniform Resource Locator.

Being a web developer in this day and age will have to work with URLs at some point, and it’s the sort of knowledge that should be known by developers and users alike. (In fact as a web developer it will be pretty much impossible not to work with URLs and there really is no excuse as they are very easy and there isn’t much to it!)

A URL is another word for a web address. It can be composed or words (www.google.com) or an internet protocol (Also called an IP address – these are all numbers.)

A URL is pretty easy, right? I mean it starts with “http” and ends with “.com”. (or .org or .ca..etc) But there are actually nine parts to a URL. (This is the URL Syntax.)

A URL can have a very small code, like: “http://www.google.co.uk/.site”
(In technical terms this would mean: “scheme://prefix.domain:port/path/filename.”)

…Or it can look more like this… “https://www.google.lu/?gws_rd=cr,ssl&ei=57KdV7XWMarE6ASfmL6IAw#q=web+server+and+database+difference”


So here are all parts explained, called URL Syntax:

Scheme – A scheme defines the type of internet service that you are using. (The most common is http)

The Prefix  is the default for that service, with http the prefix would be www.

The Domain Name is your website address, such as google’s domain name can be http://www.google.co.uk or you can have http://www.coolwebsitehere.com…

Port – A port defines the “port” number to the host… There are 0 to 65535 port numbers used for different servers, but http’s most used and default port is 80. (A bit confusing, I know.)

Path – A path is the path of one page of the webpage which can change paths to other pages or there will be a path in acting as the computer says it cannot access computer page. (If omitted.)

A filename is basically what it says, it is the name of a document or recourse.

Or you could come accross URL’s with usernames and passwords. (These come up fairly often as two first parts of the URL.

Perimeters.. Those are when you see a big long crazy list of numbers and letters, they appear after the Path and are separated by characters such as / . =  +, etc.

Query: This is the preferred way to send some parameters to a resource on the server. These are “key-value” pairs and are separated from the rest of the URL by a question mark (?) or are normally separated from each other by & (ampersand) character. It is also legal to use a semi colon: (;)


What about those ASCII characters I was on about? Well…

Characters that have special meaning within a URL are known as “reserved characters”. That means that they are more meaningful, if a query chatacter is being used in a URL that shouldn’t be then it will excaped before being included in a URL, or they can separate components from each other.

";" | "/" | "?" | ":" | "@" | "&" | "=" | "+" | "$" | ","

Or there are unreserved characters… They can be included in a URL and are not escaped but are not highly recommended as some browsers will not accept them in a URL.

"-" | "_" | "." | "!" | "~" | "*" | "'" | "(" | ")"

Unwise characters are at your own risk to use, so I recommend not using at all in a URL simply because it may lead to a page that you cannot escape..

"{" | "}" | "|" | "\" | "^" | "[" | "]" | "`"

… and this last set of characters are called an excluded character set because they are not accepted by ASCII:

“<” | “>” | “#” | “%” | ‘”‘

 


 


Oh, yeah, and Scheme can often be misunderstood:

– HTML (Hyper Text Transfer Protocol) is not encrypted and is commonly used on most webpages.

– HTTPS (Secure Hyper Text Protocol) is encrypted and is used for secure webpages.

– FTP (File Transfer Protocal) is used for downloading or uploading files to your computer, and, well, a File will open that file on your computer.
Phew! That was a lot! Well done. 🙂