What is URL (Uniform Resource Locator)?
A uniform resource locator (URL) indicates the location of a website or other online resource. It acts as a sort of Internet street address and gives you important information, including the application-layer protocol that will be used when information is transferred between a host device and your machine.
A URL contains the protocol used to access a resource, the location of the server hosting it, and the location of the resource in the server’s directory structure. It may also contain the server’s designated port number, or an additional element fragment identifier. You just need to know where to look.
You use a URL by typing or pasting it into your web browser’s address bar. URLs can also be linked within a web page, document, or email. When you click them, they redirect you to a site or file. The information hosted there is then delivered to your web browser window.
Key Takeaways
- A URL (Uniform Resource Locator) is the unique Internet address of a website or other online resource.
- URLs can represent HTML pages, CSS documents, PDFs, images, media files, or other digital resources hosted on an Internet server.
- They follow a common structure that allows them to be understood by any internet device or application.
- They also provide a human-readable entry point for websites that can be committed to memory and easily typed into a browser’s address bar.
- Following correct URL syntax can make the difference between success and failure in SEO.
Where is the URL Located?
You can find the URL of any web page you’ve visited by looking at the address bar on your browser window, though different browsers will represent the URL in different ways.
Chrome, for example, simplifies the URL display by default to make the page location easier to read and remember. By moving your cursor to the end of the URL and clicking, Chrome will display the full URL, including the protocol.
Internet files such as images also have URLs of their own. To see an image URL in Chrome, right-click on the image in the browser window and select ‘copy image address.’
URL Structure
URLs have a standard anatomy and are always structured the same way:
- Protocol name (either HTTP or HTTPS).
- Colon and two slashes (://).
- Location of the server, which is called the domain (ex: domain/xxxx).
- The directory path, which is the location of the resource on the server (ex: domain/path).
- The port (optional).
- The fragment identifier (optional).
Generically, the format creates a character string that looks like this:
Protocol://location:port/file-on-server.htm?querystring=1
The most common protocols are HTTP and HTTPS, which are also referred to as schemes. The server’s location is generally a domain name like Google.com.
An example of a URL address for a website home page would be https://www.techopedia.com/
Types of URL
There are two types of URLs, absolute and relative.
URL Syntax
URLs follow a standard structure, and also use a standard language or syntax. These are the rules and conventions that dictate how a URL should be written. When you’re building a website, sticking to accepted syntax enables web browsers and servers to understand exactly what resource a user is looking for and deliver the correct results.
In addition to the mandatory structural elements of a URL detailed above, URLs can also include things like anchor links or fragments, which send you directly to specific content on a page. Fragments are indicated by a hash symbol (#) followed by the name of the anchor.
Knowing correct URL syntax helps you to create easily searchable URLs, something vital for search engine optimization (SEO).
URL Importance for SEO
SEO strategies depend on well-structured URLs to help users easily find a website or hypertext markup language (HTML) page. If your organization relies on SEO to drive web traffic, your website URLs need to be SEO-friendly. In practice, that means creating URLs that search engines can easily locate and index.
SEO best practices for URLs include using a proper URL structure, using the HTTPS protocol (because it indicates a higher level of security), and hosting the site so that the protocol and www prefix can be hidden for easier reading. It’s also a good idea to use commonly searched keywords that match the age content within the URL.
Why URLs Can Be Confusing
To make it easier for web users, companies have started displaying URLs in a simpler format that excludes generic info like ‘http/https’ and ‘www,’ while some web browsers have started using this pared-down format by default.
The use of URL fragments to deliver users to a specific passage on a web page – usually after typing a question into a search engine – can also create lengthy and hard-to-read URLs.
5 Tips for Creating User-Friendly URLs
Make them as short as possible.
Focus on making them readable.
Use hyphens as separators, not underscores.
Avoid special characters.
Establish a consistent URL naming convention that gives the pages on your site a logical structure.
The Bottom Line
URLs are the Internet’s equivalent of listings in a phone directory. By definition, they’re unique locators that browsers and search engines can use to dial up web resources, even pinpointing specific images or even passages of text on a page. Getting them right and using established syntax makes it easy for users to find what they are looking for online.