https://www.semrush.com/blog/what-is-a-url/
What Is a URL?
A uniform resource locator (URL) is the web address of a specific page or file (PDF, video, image, etc.) on the internet.
A URL is what’s in your browser’s address bar as you read an article.
The URL in this example is semrush.com/blog/meta-description.
When you type a URL into your browser, the browser figures out which website you're looking for and asks it to send you the requested resource.
The website’s server then sends the requested content back to your browser, which shows it to you on your screen.
Why Are URLs Important?
URLs are important because they identify every unique resource and make it easy for users to access the exact pages or files they want.
URLs also make it easy to share content with others by simply sending a link.
And search engines consider URLs when deciding which results to show. For instance, Google may review words in the URL to help determine a page’s topical relevance.
URLs benefit developers and site owners, too. Because URLs make it easy to structure sites and manage content.
The Structure of a URL
The structure of a URL consists of several distinct parts:
Parts of a URL are the scheme, subdomain, domain name, top-level domain, path which includes subfolder and slug, parameters, and anchor.
Scheme
The scheme is the first part of the URL that indicates the protocol—the set of rules the browser uses to request a resource.
There are several types of protocols. But hypertext transfer protocol (HTTP) and hypertext transfer protocol secure (HTTPS) are the ones you’ll see most frequently.
If a URL has the “http” prefix (e.g., “http://sitexyz.com”), then it’s using HTTP. But this protocol has security loopholes that may be used to intercept data.
HTTPS is the secure version that encrypts data transferred between a website and a server to keep it protected.
HTTPs encrypts user information as it transfers from the browser to the website's server.
Google has confirmed that it uses HTTPS as a ranking signal.
Subdomain
A subdomain (if present) is the part of a URL that appears before the main domain name.
Distinct site sections like blogs and help centers often live on subdomains. In that case, the full URL would be something like “https://help.example.com.” Like here:
Shopify's Help Center exists at the subdomain help. The full URL is help.shopify.com.
Subdomains are also helpful when a site targets different regions or languages. Semrush, for instance, uses “https://fr.semrush.com/” for French-speaking visitors and “https://es.semrush.com/” for Spanish-speaking markets.
Some SEOs dislike subdomains because they think Google views them as separate entities.
But Google’s understanding of site structures is likely sophisticated enough to understand the connection between the primary domain and its subdomains.
Domain Name
A domain name is the main part of a URL that acts like the name of a business. For example, in "www.semrush.com," the domain name is "semrush."
Each domain name is unique. And should be relevant and easy to remember.
Top-Level Domain
A top-level domain (TLD) is the part of a URL that comes immediately after the domain name. For instance, in "example.com," the TLD is ".com."
TLDs help classify websites based on their purpose, type, or location.
Here are some examples of TLDs and which types of organizations or countries they are used in:
.com: Commercial or general-purpose websites
.org: Nonprofit organizations or communities
.net: Internet providers or web hosting companies
.gov: Government departments and agencies
.edu: Educational institutions such as colleges and universities
.uk: United Kingdom
.de: Germany
.jp: Japan
.fr: France
Using appropriate TLDs signals relevancy. For instance, a university without a “.edu” domain may look unusual to users. And country code TLDs (ccTLDs) help you attract a local audience.
Path
The path is the part of a URL that comes after the domain, such as “/blog/content-strategy-guide.” It shows users and search engines where a page lives on your website.
The path commonly includes a subfolder and a slug, though not every URL has a subfolder.
A subfolder is a section within a website that appears after the main domain name and top-level domain in a URL. For example, in "example.com/blog," the subfolder is "blog."
A subfolder helps organize content into different categories or directories on the same domain.
A hierarchical diagram showing a website domain divided into "Blog" and "News" sections, each containing two individual posts or articles, illustrating site structure using subfolders.
A slug is the part of a URL that comes after the domain and subfolder (if there is a subfolder). It identifies a specific page on a website and consists of words separated by hyphens that describe the page’s content.
For example, in "example.com/blog/url-structure-guide," the slug is "url-structure-guide."
Slugs help both users and search engines understand what a page is about.
Parameters
Parameters are values added to the end of a URL to modify a page and begin with a question mark (?).
Each parameter typically has a key and a value that are separated by an equal sign. In the example "?category=shoes," "category" is the key and "shoes" is the value.
You can also include multiple parameters in a URL by joining them with ampersands (&).
Here’s how Nike uses parameters to show the newest men’s shoes:
Nike product page has the parameter ?sortBy=newest in the URL.
URL parameters can be a useful functionality, but they can confuse users and impact your search visibility if they aren’t managed properly.
Anchor
An anchor (also called a fragment identifier) is the last part of a URL that starts with a hash symbol (#). It takes users to a specific section within a webpage rather than the whole page.
For example, in "example.com/help#pricing," the anchor "#pricing" takes the user straight to the pricing section of the help page.
An anchor is also added to a URL when you want to link to a particular timestamp in a video or use the “Copy link to highlight” option in Chrome.
Like this:
Highlighted text is right clicked to show "copy link to highlight" option.
Types of URLs
Let’s take a closer look at different types of URLs and their purposes.
Absolute URLs
An absolute URL is a complete web address that includes all the necessary information (protocol, domain, path, etc.) to locate a specific page or file.
For example:
https://www.example.com/products/shoes
Absolute URLs are often used in external links, emails, or syndicated content to ensure the link properly leads to an external resource.
Relative URLs
A relative URL is a web address that only includes the path (everything that comes after the domain).
For example:
/blog/first-post/
Relative URLs are mainly used for internal links because they’re shorter and easier to manage, especially during site updates or migrations.
Canonical URLs
A canonical URL is the preferred URL of a webpage that you want search engines to index (store in a database). It’s used when several duplicate or near-duplicate versions of that page exist.
For example, if both "https://www.example.com/shoes/" and "https://www.example.com/shoes/?page=1" show the same content, you can mark the first one as canonical.
Specifying a canonical version helps to ensure the right one is displayed in search results and keeps your pages from competing with one another.
Vanity URLs
A vanity URL is a custom, branded link that’s short, simple, and easy to remember. It often redirects to a longer or more complex URL, but it looks cleaner and is designed for marketing purposes.
For example:
example.com/sale
The main purpose of a vanity URL is to make links more appealing and easier to share, especially in ads, on social media, or in print.
You can create vanity URLs using URL shortener tools like TinyURL or Bitly. Or you can also create them in your CMS and then set up a 301 redirect to the actual page.
6 URL Best Practices
Well-structured URLs make your site easier to navigate and can elevate your SEO performance.
Below are six best practices to keep your URLs effective.
1. Use HTTPS Over HTTP
Install a Secure Sockets Layer (SSL) certificate on your website to ensure your site’s URLs begin with "https" instead of "http."
Most web hosting providers offer SSL certificates, some even for free.
HTTPS can build trust with visitors. And it’s also a confirmed Google ranking factor.
Modern browsers now flag HTTP sites as “Not Secure.”
Not secure message says "your connection is not private."
We analyzed a selection of keywords to determine how many of the top 100 search results for each keyword are HTTP URLs.
Keywords
Number of HTTP URLs in the Top 100 Search Results
healthy eating tips
0
how to get a passport
1
what is seo
0
how to get a work visa in france
0
is green tea healthy
1
summer vacation ideas
0
what is a url
0
what is a pension plan
0
irs file taxes
1
texas car registration
9
Out of the 1,000 analyzed search results, only 12 were HTTP URLs across four different keywords. This provides evidence that using HTTPS across your site may benefit your search engine rankings.
2. Keep It Short and Simple
Create URLs that are easy to read, type, and remember. Because these types of URLs look better to users and are easier to share.
For example, use "example.com/shoes" instead of "example.com/category/products/footwear/shoes123."
3. Use Clear and Descriptive Words
Write URLs using plain but specific words that accurately describe the page content. Avoid vague terms, abbreviations, or auto-generated codes.
For example, use "example.com/blog/how-to-write-a-resume" instead of "example.com/post?id=456."
We also recommend you avoid numbers to reduce the chances that you need to update the URL when you refresh a piece of content.
Here’s how we wrote an article on the top 10 writing tips without using the number in its URL:
A blog titled 10 tips for writing awesome web content is at the URL semrush.com/blog/website-content.
Plus, clear URLs give search engines useful context about the page’s topic. This can improve rankings.
4. Be Careful with Parameters
Use parameters when they’re needed, such as for tracking or filtering content. But be sure to include a canonical tag (HTML that indicates the main version of a page) to identify the primary version of a page that doesn’t contain parameters in the URL.
Carefully managing parameters reduces the risk of duplicate content—when you have multiple pages with identical or nearly identical content. This can confuse search engines about which page to prioritize, and that can prevent all versions from showing in search results.
To determine how frequently parameters show up in top-ranking URLs, we looked into the top 100 search results for each of the following 10 keywords.
Keywords
Number of Parameterized URLs in the Top 100 Search Results
healthy eating tips
8 (mostly YouTube pages)
how to get a passport
5
what is seo
18 (mostly YouTube pages)
how to get a work visa in france
7
is green tea healthy
10
summer vacation ideas
3
what is a url
17 (mostly YouTube pages)
what is a pension plan
5 (mostly YouTube pages)
irs file taxes
13 (mostly YouTube pages)
texas car registration
14 (mostly YouTube pages)
Out of 1,000 analyzed search results, parameters have shown up in 100 URLs. And 75% of these are URLs of YouTube pages.
This aligns with the idea that URLs with parameters don’t appear as often in search results.
YouTube pages generally contain parameters. So, it’s unsurprising to see those pages ranking.
5. Use Hyphens to Separate Words
Use hyphens (-) in slugs to separate words instead of underscores (_), including spaces, or running words together.
Hyphens improve readability for users, especially when URLs are shared in plain text or read aloud. They also make it easier for users to understand what a page is about.
Also, Google recommends using hyphens because they help “search engines identify concepts in the URL more easily.”
6. Stick to Lowercase Characters
Make sure all your URLs use lowercase letters because URLs can be case-sensitive.
This means "example.com/About" and "example.com/about" could lead to two different pages if you have one for each. And that creates duplicate content issues.
Plus, lowercase URLs are easier to read, type, and share.
Check Your URLs for Issues
Manually reviewing URLs for the above issues can be time-consuming.
Semrush’s Site Audit tool can help you identify issues with URLs automatically.
Follow the prompts to configure your audit. Then, navigate to the “Issues” tab and search for “URL.”
URL is entered into the search bar.
This will display certain URL issues your site might have. Like URLs containing underscores. Or URLs that are too long.
Warnings for this example site include temporary redirects, underscores in the URL, too many parameters in the URL, and more.
The tool also provides advice on how to solve a particular issue.
A pop up appears for the underscores in URL issue, explaining more about the issue and how to fix it.
Give Site Audit a try.
A uniform resource locator (URL), colloquially known as an address on the Web,[1] is a reference to a resource that specifies its location on a computer network and a mechanism for retrieving it. A URL is a specific type of Uniform Resource Identifier (URI),[2][3] although many people use the two terms interchangeably.[4][a] URLs occur most commonly to reference web pages (HTTP/HTTPS) but are also used for file transfer (FTP), email (mailto), database access (JDBC), and many other applications.
Most web browsers display the URL of a web page above the page in an address bar. A typical URL could have the form http://www.example.com/index.html, which indicates a protocol (http), a hostname (www.example.com), and a file name (index.html).
History
Uniform Resource Locators were defined in RFC 1738 in 1994 by Tim Berners-Lee, the inventor of the World Wide Web, and the URI working group of the Internet Engineering Task Force (IETF),[7] as an outcome of collaboration started at the IETF Living Documents birds of a feather session in 1992.[7][8]
The format combines the pre-existing system of domain names (created in 1985) with file path syntax, where slashes are used to separate directory and filenames. Conventions already existed where server names could be prefixed to complete file paths, preceded by a double slash (//).[9]
Berners-Lee later expressed regret at the use of dots to separate the parts of the domain name within URIs, wishing he had used slashes throughout,[9] and also said that, given the colon following the first component of a URI, the two slashes before the domain name were unnecessary.[10]
Early WorldWideWeb collaborators including Berners-Lee originally proposed the use of UDIs: Universal Document Identifiers. An early (1993) draft of the HTML Specification[11] referred to "Universal" Resource Locators. This was dropped some time between June 1994 (RFC 1630) and October 1994 (draft-ietf-uri-url-08.txt).[12] In his book Weaving the Web, Berners-Lee emphasizes his preference for the original inclusion of "universal" in the expansion rather than the word "uniform", to which it was later changed, and he gives a brief account of the contention that led to the change.
Syntax
Main article: Uniform Resource Identifier § Syntax
Part of this section is transcluded from Uniform Resource Identifier. (edit | history)
Every HTTP URL conforms to the syntax of a generic URI. The URI generic syntax consists of five components organized hierarchically in order of decreasing significance from left to right:[13]: §3
URI = scheme ":" ["//" authority] path ["?" query] ["#" fragment]
A component is undefined if it has an associated delimiter and the delimiter does not appear in the URI; the scheme and path components are always defined.[13]: §5.2.1 A component is empty if it has no characters; the scheme component is always non-empty.[13]: §3
The authority component consists of subcomponents:
authority = [userinfo "@"] host [":" port]
This is represented in a syntax diagram as:
URI syntax diagram
The URI comprises:
A non-empty scheme component followed by a colon (:), consisting of a sequence of characters beginning with a letter and followed by any combination of letters, digits, plus (+), period (.), or hyphen (-). Although schemes are case-insensitive, the canonical form is lowercase and documents that specify schemes must do so with lowercase letters. Examples of popular schemes include http, https, ftp, mailto, file, data and irc. URI schemes should be registered with the Internet Assigned Numbers Authority (IANA), although non-registered schemes are used in practice.[b]
An optional authority component preceded by two slashes (//), comprising:
An optional userinfo subcomponent followed by an at symbol (@), that may consist of a user name and an optional password preceded by a colon (:). Use of the format username:password in the userinfo subcomponent is deprecated for security reasons. Applications should not render as clear text any data after the first colon (:) found within a userinfo subcomponent unless the data after the colon is the empty string (indicating no password).
A host subcomponent, consisting of either a registered name (including but not limited to a hostname) or an IP address. IPv4 addresses must be in dot-decimal notation, and IPv6 addresses must be enclosed in brackets ([]).[13]: §3.2.2 [c]
An optional port subcomponent preceded by a colon (:), consisting of decimal digits.
A path component, consisting of a sequence of path segments separated by a slash (/). A path is always defined for a URI, though the defined path may be empty (zero length). A segment may also be empty, resulting in two consecutive slashes (//) in the path component. A path component may resemble or map exactly to a file system path but does not always imply a relation to one. If an authority component is defined, then the path component must either be empty or begin with a slash (/). If an authority component is undefined, then the path cannot begin with an empty segment—that is, with two slashes (//)—since the following characters would be interpreted as an authority component.[16]: §3.3
By convention, in http and https URIs, the last part of a path is named pathinfo and it is optional. It is composed by zero or more path segments that do not refer to an existing physical resource name (e.g. a file, an internal module program or an executable program) but to a logical part (e.g. a command or a qualifier part) that has to be passed separately to the first part of the path that identifies an executable module or program managed by a web server; this is often used to select dynamic content (a document, etc.) or to tailor it as requested (see also: CGI and PATH_INFO, etc.).
Example:
URI: "http://www.example.com/questions/3456/my-document"
where: "/questions" is the first part of the path (an executable module or program) and "/3456/my-document" is the second part of the path named pathinfo, which is passed to the executable module or program named "/questions" to select the requested document.
An http or https URI containing a pathinfo part without a query part may also be referred to as a 'clean URL,' whose last part may be a 'slug.'
Query delimiter Example
Ampersand (&) key1=value1&key2=value2
Semicolon (;)[d] key1=value1;key2=value2
An optional query component preceded by a question mark (?), consisting of a query string of non-hierarchical data. Its syntax is not well defined, but by convention is most often a sequence of attribute–value pairs separated by a delimiter.
An optional fragment component preceded by a hash (#). The fragment contains a fragment identifier providing direction to a secondary resource, such as a section heading in an article identified by the remainder of the URI. When the primary resource is an HTML document, the fragment is often an id attribute of a specific element, and web browsers will scroll this element into view.
A web browser will usually dereference a URL by performing an HTTP request to the specified host, by default on port number 80. URLs using the https scheme require that requests and responses be made over a secure connection to the website.
Internationalized URL
Internet users are distributed throughout the world using a wide variety of languages and alphabets, and expect to be able to create URLs in their own local alphabets. An Internationalized Resource Identifier (IRI) is a form of URL that includes Unicode characters. All modern browsers support IRIs. The parts of the URL requiring special treatment for different alphabets are the domain name and path.[18][19]
The domain name in the IRI is known as an Internationalized Domain Name (IDN). Web and Internet software automatically convert the domain name into punycode usable by the Domain Name System; for example, the Chinese URL http://例子.卷筒纸 becomes http://xn--fsqu00a.xn--3lr804guic/. The xn-- indicates that the character was not originally ASCII.[20]
The URL path name can also be specified by the user in the local writing system. If not already encoded, it is converted to UTF-8, and any characters not part of the basic URL character set are escaped as hexadecimal using percent-encoding; for example, the Japanese URL http://example.com/引き割り.html becomes http://example.com/%E5%BC%95%E3%81%8D%E5%89%B2%E3%82%8A.html. The target computer decodes the address and displays the page.[18]
Protocol-relative URLs
Protocol-relative links (PRL), also known as protocol-relative URLs (PRURL), are URLs that have no protocol specified. For example, //example.com will use the protocol of the current page, typically HTTP or HTTPS.[21][22]