URL, organisation, grammar and recommended methods

In this guide, we'll explore the components of a URL, the guidelines to follow and the techniques for creating URLs that enhance the user experience and improve search engine rankings
A URL, also known as a Uniform Resource Locator, is the distinct location of every page, image and file found on the Internet. Think of it as the digital location of your website, directing both visitors and search engines to the correct information. Having an understanding of the functionality of URLs and adhering to the recommended guidelines for their format is crucial to ensuring that your website is easy to navigate and optimising its visibility in search engines.
1

Understanding the structure of URLs

In this section, we will examine the structure of a URL. Consider this section as the framework for a properly formatted web URL.

The protocol
Each URL starts with a protocol, with the most prevalent being:

  • HTTP (Hypertext Transfer Protocol): The standard protocol for web communication without encryption. It is crucial for fundamental web surfing, yet provides restricted security;
  • HTTPS (Hypertext Transfer Protocol Secure): This upgraded form of HTTP incorporates an encryption layer (SSL/TLS) to safeguard the information exchanged between your site and users' browsers. HTTPS is essential for websites that manage critical activities like logins, payments, or personal data.

Why HTTPS is important

  • Security: HTTPS protects against eavesdropping and data tampering, ensuring that users' information remains private;
  • SEO: Search engines like Google give websites protected by HTTPS a boost in position, as they recognise your commitment to your visitor's security;
  • User confidence: Observing the ‘HTTPS’ emblem and padlock in their browser fosters greater trust among visitors;
  • Performance: Modern web technologies, such as HTTP/2, often require HTTPS, which leads to potential speed benefits.

HTTPS by default: At Studio.351 we always set HTTPS on our clients' websites.

The domain name
Your domain name serves as the distinct identifier for your website, similar to the street name in your web address. In general, it consists of two fundamental parts:

  • Second-level domain (SLD): This is the primary name you select, usually representing your brand or the site's purpose (e.g. ‘studio351’ in ‘studio351.pt’);
  • Top-level domain (TLD): This signifies the suffix at the end (e.g. .com, .org, .net, etc.). Numerous TLDs exist, with some being generic, others tailored to specific countries, and some aimed at niche markets.

Types of domains
Below are a few examples to demonstrate the diverse range of domain names:

  • Generic TLDs: .com, .net, .org;
  • Country code TLDs (ccTLDs): .uk, .ca, .au;
  • New and sponsored TLDs: .blog, .photography, .xyz.

Choosing the right domain for you

  • Relevance: Align your area of expertise with the emphasis of your brand or website;
  • Memorisation: It should be easy to remember and spell;
  • Availability: Check that the domain name you want is still accessible;
  • TLD factors: .com is generally a reliable option, but other TLDs may be effective if they relate to your niche.

The path
The path in a URL indicates the precise location of a page, file, or resource within the website's directory layout. It comes after the domain name and employs slashes (/) to divide directories and subdirectories.

Example
In the URL https://studio351.pt/blog/url-structure/, the path is /blog/url-structure/. This probably indicates a blog post entitled ‘URL Structure’ in the ‘Blog’ section of the website.

How the path affects navigation and organisation

  • Intuitive navigation: A properly organized route establishes a coherent flow throughout the website, allowing visitors to locate what they seek more easily;
  • SEO indicators: Well-defined structures assist search engines in comprehending the hierarchy and arrangement of website content, thereby enhancing search rankings.

Query parameters
Query parameters are extensions to a URL commonly utilized to transmit particular information or directions to a website. They begin with a question mark (?) and are presented in key-value pairs separated by ‘ampersands’ (&).

Example
https://www.studio351.pt/search?q=URL&category=SEO
In this example:

  • q is a variable denoting the search request ('URL');
  • Category is a parameter that defines the content class (‘SEO’).

How query parameters are used

  • Filtering and sorting: Actively adjust product lists or blog archives according to user preferences (e.g., size, color, price range);
  • Search: Relay a user's search queries to the website's search engine;
  • Pagination: Show the current page number in a sequence (e.g. page=2);
  • Monitoring: Incorporate campaign tracking codes to observe traffic origins (frequently concealed from the user).

Query and SEO parameters: Potential considerations

  • Duplicate content: Overusing query parameters can generate numerous URL variations that refer to the same or nearly identical content. This may result in confusion for search engines;
  • Crawlability: Not all possible parameter combinations may be indexed by search engines, which could restrict the visibility of certain content on your site.

Fragments
Fragments function like anchors on an individual web page. They begin with a hash symbol (#) and denote a particular part of a page. When you click on a link with a fragment, the browser jumps to that specific section.

Example

https://studio351.pt/#projects
In this example, the #projects fragment would probably direct the user to the ‘Projects’ section of the web page.

How fragments are used

  • Page navigation: Establish index links or ‘jump to’ navigation for extensive pages;
  • Scroll position retention: Enable users to return to a designated spot on a page after refreshing or exiting the navigation.

SEO and fragments

Search engines don't usually take anything into account after the fragment symbol in a URL. Their main focus is on the main URL when categorising content.
2

Rules that must be respected when using the URL syntax

Although there is some flexibility in the way URLs are constructed, there are specific rules to follow to ensure that they work correctly in browsers and are understood by search engines. Here's a breakdown:

Allowed characters
These can be used freely in URLs:

  • Letters: A-Z, a-z;
  • Numbers: 0-9;
  • Special characters: - . _ ~.

Reserved characters
They have special meanings in URLs (/, ?, #, etc.). If you need to use them as part of the names of your pages or files, they should be encoded.

Percentage encoding

Percentage encoding is a mechanism for indicating reserve characters. It involves replacing a reserved character with a percentage sign (%) followed by the character's two-digit hexadecimal code.

Example
An encoded space character becomes %20.

When percentage encoding occurs

  • Most web servers and browsers process encoding automatically when spaces or special characters are used in file names or URLs created through website developers;
  • You may need to manually encode characters if you are building URLs from scratch.

Case sensitivity
Technically, URLs are case sensitive. However, it is widely considered best practice to:

  • Use only lowercase letters: Promotes consistency and avoids confusion;
  • Treat URLs as case-sensitive on your server: Make sure your web server handles case variations correctly, especially for files.

Additional syntax considerations

  • URL length: Although there is no strict technical limit, browsers and servers may have restrictions on the length of a URL;
  • Best practice: Keep URLs as concise as possible, while remaining descriptive. This improves readability and the likelihood that they will be correctly shared and indexed.

Underscores or hyphens?
Both are technically allowed in URLs.

Hyphens (-) are generally favoured: Search engines treat hyphens as word separators, helping them to understand the content of your URLs. Underscores can be misinterpreted as being part of a single word.
3

Types of URLs

Comparison between absolute and relative URLs

  • URLs that provide the full address of a specific web page.
They include the full address of a resource, such as the protocol, domain name and any path or file name (e.g. https://www.studio351.pt/blog/cms). They indicate exactly the specific position online.

  • URLs that are relative.
They only give the path in relation to the current page (/blog/hello-world/, for example). Their location depends on the base URL of the page on which they are located.

When to use each one
URLs that include the full path and destination of a web page.

  • Links to websites that are not internal;
  • Make sure that hyperlinks always lead to the right destination, even in the event of changes to the layout of the website.

Relative URLs

  • Establish connections among various pages on your website;
  • Possibly improving page loading speed (since the browser won't have to resolve the domain information again).

Static URLs vs dynamic URLs

Static URLs link directly to a real file on the web server, such as https://www.studio351.pt/servicos.html. Their structure is stable.

The web server creates dynamic URLs in real time, usually using query parameters such as https://www.myshop.com/products?category=shoes&size=10. The way they are created can vary depending on the data entered by the user or the information in the database.

Dynamic URLs should be taken into account when it comes to SEO.
Make sure that dynamic URLs are transparent and described and try to avoid overly complex parameter structures wherever possible.
Canonicalisation involves using canonical URLs to indicate the preferred version of a page in cases where several URL variations may result in the same content.
Traceability: Make sure that dynamic URLs are understandable and can be followed by search engines.
4

Optimal guidelines for UX and SEO in URLs

Crafting well-organized URLs not only enhances your website's user experience, but it also affects how search engines view your content. Let’s examine the main components:

Clarity and readability

  • Descriptive terms: Implement keywords that correctly represent the page's content (for instance, /wordpress-hosting-guide/ is more informative than /page1.html);
  • Separation: Utilize hyphens (-) between words to enhance clarity;
  • Steer clear of keywords: Refrain from using superfluous keywords; URLs must integrate seamlessly.

Keyword optimisation

  • Relevance: Carefully incorporate your target keywords into your URLs where appropriate;
  • Position: Positioning keywords nearer to the start of the URL may hold slightly more significance;
  • Don't overdo it: Concentrate on one main keyword or phrase per URL.

Practical considerations regarding length

  • Brevity: Seek out URLs that are easily readable, memorable, and shareable for users.
  • Balance: Provide detailed descriptions, but steer clear of overly lengthy URLs;
  • Avoid unnecessary terms: Eliminate filler words such as ‘the’, ‘and’, etc., if they do not contribute meaning.

Hierarchical structure
A well-organised URL structure reflects the organisation of the website's content.

Example: https://www.garden.com/flowers/greens/newdelivery/

  • flowers: Category
  • greens: Sub-category
  • newdelivery: Specific page

Benefits for UX and SEO

  • Enhanced navigation: Users can clearly grasp their location on the website and the connections between different pages;
  • Breadcrumbs: Hierarchical URLs make it easier to realise clear breadcrumb navigation;
  • SEO indicators: Search engines are able to grasp the context and thematic connections of your content more effectively.

Consistency
Maintaining consistency in the way URLs are formatted benefits both users and search engines. Here's why it's essential:

  • User expectations: Predictable URL patterns make your site easier to navigate and inspire confidence in your users;
  • Preventing confusion: Modifying URL formats randomly may disrupt current links and lead to annoyance if users have saved pages;
  • SEO benefits: Search engines may favour websites with consistent URL patterns, as they demonstrate organisation and attention to detail.

Key areas for consistency

  • Use of upper and lower case: Choose URLs in lower case and stick to it;
  • Hyphens and Underscores: Select one and use it uniformly;
  • Slashes at the end: Choose whether to add a slash (/) at the end of directory URLs and adhere to the selected format (e.g. /blog/ vs. /blog).

Avoid changes (where possible)
URLs are meant to serve as permanent locations for your content. Altering them without reason can lead to adverse effects:

  • Broken links: External sites, bookmarks and old shares on social networks that point to the original URL will give rise to 404 errors (404 pages);
  • Loss of SEO value: It may take search engines a while to re-index the page at its new location, and any link authority established for the previous URL must be reinstated.

When URL changes are necessary
Sometimes URL changes cannot be avoided, for example:

  • Site reorganisation: Major changes to the organisation of content may warrant adjustments to the URL;
  • Rebranding: A new web address might necessitate a total revision of the URL;
  • Correcting typos or heavy URLs: Correcting significant errors in a URL may be worthwhile.

301 redirects: Your best friend
The essential method for reducing the effects of URL alterations is to implement 301 redirects:

How they work: A 301 redirect informs browsers and search engines that a page has been permanently transferred to a new location. It automatically reroutes users and retains most of the SEO benefit from the original URL.

Types of redirects

  • Page-level redirects: Send each old URL to its corresponding new version;
  • Directory redirects: Redirect complete sections of your site if the layout has been altered.
5

FAQ

  • What is a URL?
A URL (Uniform Resource Locator) is the address of a resource on the Internet, such as a web page, image or file. It is used to locate and access content on the web.

  • What is the structure of a URL?
A URL usually includes the protocol (http:// or https://), the domain (e.g. www.exemplo.com), and the path to the specific resource (e.g. /page1). Sometimes it also includes additional parameters, such as ?id=123.

  • What is the difference between a URL and an IP address?
The URL is the friendly address used to access websites, while the IP address is a numerical sequence that identifies a server on the Internet. The URL is translated into an IP via the DNS.

  • How does a URL influence SEO?
Friendly, short and descriptive URLs help search engines understand the content of a page. Using relevant keywords in the URL can improve the site's ranking.

  • Why is it important to have a secure URL (HTTPS)?
URLs with ‘https://’ are secure, using SSL/TLS encryption to protect the data exchanged between the server and the user. This is essential for visitor security and trust.

  • Is it possible to modify the URL of a current page?
It is possible to change the URL of a page, but it is important to set up appropriate redirects (such as 301) to avoid losing traffic and jeopardising SEO.

  • How can I optimise a site's URL?
To optimise a URL, use relevant keywords, avoid special characters, keep it short and clear, and if possible, use hyphens (-) to separate words.

  • What are URL parameters?
Parameters are additional information that can be added to the end of a URL to personalise the request, such as ?id=123 or ?category=technology. They are commonly used on dynamic sites.
6

Summary

URLs (Uniform Resource Locators) are essential for navigating the web. They identify resources and define the structure for web addresses, including the protocol, domain, path, and parameters. A well-structured URL enhances user experience and SEO by making it easier for both search engines and users to understand the content of a page. Best practices for creating effective URLs include using clear, descriptive keywords, avoiding unnecessary characters, and optimizing for mobile. Proper URL structure is key for improving website performance, visibility, and ranking on search engines.