Complete guide to URLs: types, structure and best practices

  • A URL identifies and locates resources on the web using protocol, domain, path, parameters, and fragment.
  • Designing clear, short URLs in HTTPS with good hierarchy improves crawling, SEO and user experience.
  • Controlling parameters, duplicates, and 301 redirects is key for large websites and online stores.
  • Choosing the right URLs between static/dynamic, absolute/relative and managing canonicals avoids indexing problems.

Complete guide to URLs

We use URLs constantly without thinking about itWhen you click on an ad, check your online bank, open your email client, or visit your favorite website, there's always a unique address that the browser interprets to take you to the correct resource. That seemingly innocent string of text is, in reality, one of the technical pillars of the internet and a cornerstone of any serious SEO strategy. URLs: what they are, structure, types and SEO best practices.

To fully understand what a URL is, how it is constructed, what types exist, and what best practices to follow It's not just "something for techies." It directly affects how Google crawls your site, how it distributes relevance among your pages, how users behave with your results, and even the security of the data they send to your website. A good URL architecture is like a clear map for both search engines and users.

What exactly is a URL and what is it used for?

A URL (Uniform Resource Locator) is the unique address of a resource on the InternetThis resource can be almost anything: an HTML page, an image, a PDF, a video, a downloadable file, an API endpoint, etc. When you type a URL into the browser's address bar or click a link, the browser uses that address to locate the server, request the resource, and display it on the screen.

The URL serves two key functions: on the one hand, identifies unequivocally a specific resource; on the other hand, It explains how to access it. (which protocol to use, which domain to access, and which route to follow on the server). That's why it's often compared to a house's postal address: it indicates the country, city, street, number, and, if necessary, even the floor and door.

In SEO, URLs have strategic importanceA good URL design facilitates crawling, avoids duplicate content, reinforces the semantic relevance of each page, improves CTR in SERPs, and helps the user understand, just by reading the address, what they will find inside.

Structure of a URL and its parts

Although at first glance a URL may seem like a simple line of text, it is made up of several well-defined components.Each part has a specific function and together they form a "path" that browsers and search bots follow to reach the correct resource.

Protocol or scheme

The protocol is the beginning of the URL and defines how the browser and the server communicate.The most common ones on the web are:

  • HTTP (HyperText Transfer Protocol): classic web protocol, without encryption.
  • HTTPS (HyperText Transfer Protocol Secure): the secure version of HTTP, which encrypts data using SSL/TLS.
  • FTP (File Transfer Protocol): protocol for transferring files between client and server.
  • mailto: special scheme to open the email client with a predefined address.

From an SEO and user trust perspective, HTTPS is mandatoryGoogle considers it a sign of quality; browsers mark websites without encryption as "not secure," and handling sensitive data without HTTPS is a serious risk.

Subdomain

The subdomain is the part that appears just before the domain name.separated by a period. The most well-known is wwwBut you can use virtually any word to organize your project into separate sections.

  • https://www.ejemplo.com → usual subdomain of the public web.
  • https://blog.ejemplo.com → subdomain for the blog.
  • https://tienda.ejemplo.com → subdomain for e-commerce.

Subdomains function almost like "separate sites" from a technical and SEO perspective.with their own files, settings and even properties in Search Console, even though they share a root domain.

Domain name and extension (TLD)

The domain is the main name of the website and is unique on the InternetIt is made up of:

  • Domain name (SLD, second-level domain): the part you choose, for example miempresa.
  • Extension or top-level domain (TLD): the “tail” that comes after the period: .com, .es, .org, etc.

TLDs can be divided into several categories:

  • generic gTLDs: .com, .net, .org, etc.
  • country code ccTLD: .es, .mx, .fr, which indicate a geographical focus.
  • sponsored sTLDs: extensions linked to specific communities or organizations, such as .travel o .asia.
  • new gTLDs: more recent and thematic extensions, such as .online, .store, .tech, .blog, etc.

Choosing a domain and TLD influences brand perception, local focus, and, in some cases, geographic positioning.. For example, a .es It sends a clear signal of direction to the Spanish public.

Route or path

The path is the part of the URL that comes after the domain and describes the internal location of the resource., usually mimicking a folder structure:

Example route: https://www.ejemplo.com/blog/seo/url-amigable

In this example, the route is /blog/seo/url-amigableThis could correspond to folders and a specific file on the server, or it could be a "virtual path" generated by the CMS. The more sections (separated by "/"), the more specific the location will be.

Query parameters or string

Parameters are additional data that is passed through the URL after a question mark. ?They are widely used in internal search engines, product filters, pagination, and campaign tracking.

General format:

Example parameters: ?clave1=valor1&clave2=valor2

object lesson:

Example search URL: https://www.ejemplo.com/busqueda?query=zapatos&pagina=2&color=negro

Here we have several parameters: query=zapatos (search term), pagina=2 (pagination) and color=negro (filter). From an SEO perspective, it's best to use them wisely to avoid generating thousands of useless combinations.

Fragment or anchor

The fragment is the part of the URL that begins with # and it allows you to jump to a specific section within the same page:

URL with snippet: https://www.ejemplo.com/guia-url#buenas-practicas

The browser interprets that fragment and shifts the view to the corresponding element in the HTML. (for example, a header with that identifier). The fragment is not sent to the server; it only affects client behavior.

Syntax and allowed characters in a URL

URL syntax best practices

A URL does not accept just any character as we write it.There are syntax rules that define which symbols can be used freely, which have a special meaning, and which must be encoded.

Unreserved characters

These are the “safe” characters, which can appear unencoded.:

  • Letters: AZ and az.
  • Digits: 0-9.
  • Special signs: - (script), _ (underscore), . (spot), ~ (prime).

In SEO, it is recommended to use lowercase letters and hyphens to separate words.because search engines interpret them as natural separators.

Reserved characters and percentage encoding

Other characters have special functions within the URL (for example /, ?, #, &, =If you need to include them as part of a resource name and not as separators, you must "escape" them with percent encoding.

Percentage coding involves replacing the character with % + its hexadecimal codeFor example, a space is represented as %20Many CMSs do this automatically, but it's worth understanding to avoid URLs full of strange symbols.

Case sensitivity and URL length

In practice, domain parts are not case-sensitive, but the path can be sensitive depending on the server.To avoid confusion, it's best to always use consistent lowercase letters in the paths.

Regarding length, although there is no strict “official” limitBoth browsers and search engines have practical thresholds. From an SEO and UX perspective, a clear and relatively short URL (generally recommended to be under 60-90 characters when possible) is much more manageable and clickable.

Types of URLs according to their structure and use

In SEO and development, URLs are often classified into several groups to better understand their behavior. and make appropriate technical decisions.

Absolute and relative URLs

Structure and parts of a URL

An absolute URL includes all the necessary informationProtocol, domain, and full path. For example:

Absolute example: https://www.ejemplo.com/blog/que-es-una-url

They are used to link resources independently of context, especially in external links, feeds, XML sitemaps, emails, etc.

A relative URL only indicates the path from the current location or from the site root.omitting protocol and domain:

Relative example: /blog/que-es-una-url

The browser assumes that the domain is the same one you are already on.It is very common to use relative URLs in internal links within the same project.

Friendly versus unfriendly URLs

When we talk about friendly (or SEO friendly) URLs, we mean clean, readable, and descriptive addresses.which give clear clues about the content:

Friendly example: https://www.ejemplo.com/curso-marketing-digital-online

Typical characteristics of a friendly URL:

  • Include relevant keywords.
  • It is easily understood when you read it.
  • It does not overuse parameters or cryptic codes.
  • It improves the CTR because the user "sees" the content before entering.

Conversely, a non-friendly URL is usually riddled with IDs and parameters that are meaningless to the user.:

Unfriendly example: https://www.ejemplo.com/p?id=1234&cat=567

This type of URL makes memorization difficult, provides no semantic context, and rarely inspires confidence.Therefore, it is advisable to limit their use to cases where they are truly necessary (internal searches, tracking, etc.).

Static and dynamic URLs

url

Static URLs are those that do not change based on user parameters or actions.They usually represent "fixed" content or, at least, content with a very stable structure:

Static example: https://www.ejemplo.com/servicios/diseno-web

They tend to be more SEO-friendly, easier to index and link to.and are the preferred option for content that you want to position consistently.

Dynamic URLs are generated on the fly from queries, filters, sessions, or pagination.and they usually include parameters in the query string:

Dynamic example: https://www.ejemplo.com/busqueda?categoria=zapatos&color=negro&orden=precio_asc

They are essential in e-commerce with many filters, in long listings, or in internal search engines.The problem arises when parameters are combined without control, resulting in the creation of thousands of almost identical URLs, cannibalizing content and wasting crawl budget.

Canonical URLs and duplicate URLs

On large websites, it is very common for the same content to be accessible from several different URLs. (for example, products filtered by color, size, order, etc.). To avoid confusion with Google, the canonical tag is used.

The canonical URL is the "official" version of a page, the one you want to be indexed and concentrate all the authority:

  • Canonical: https://www.ejemplo.com/zapatos-hombre/
  • Filtered alternative: https://www.ejemplo.com/zapatos-hombre?color=negro

url

A tag is added to the HTML code of the page. link rel="canonical" pointing to the main URL:

Canonical label: <link rel="canonical" href="https://www.ejemplo.com/zapatos-hombre/">

This clearly tells Google which version to use as a reference.avoiding problems of duplicate content and signal dispersion.

URLs with and without www

A single domain can have two accessible variants: with www and without www:

  • https://www.ejemplo.com
  • https://ejemplo.com

In the search engine's view, they are two different hosts.So you have to choose a canonical version (the one you want to use as the main one) and redirect the other with a 301, in addition to declaring it correctly in Search Console.

HTTP vs. HTTPS

HTTP was the original standard, but today working without HTTPS is a serious mistake.HTTPS encrypts communication between server and browser, protects forms, payments and personal data, and is also a ranking factor.

Basic good practices:

  • Have the entire site over HTTPS.
  • Permanently redirect (301) all HTTP versions to their HTTPS equivalents.
  • Check that there are no mixed resources left (images, scripts or styles loaded via HTTP).

Other relevant URL types

In addition to the categories above, there are certain variants with very specific uses.:

  • URLs callback: These are used to return the user or system to a source after completing an external process (for example, a payment on a gateway).
  • Vanity or short custom URLs: shortened and easy-to-remember versions that redirect to long URLs, widely used in campaigns and social networks (e.g., links created with Bitly or TinyURL).

Practical examples of URLs on the real web

What is a URL, types and structure: a basic guide for web design

Seeing specific examples helps to internalize how all these elements combine.Some typical examples:

  • Home page of a site: https://www.hostinger.es/, https://www.microsoft.com/.
  • Tutorials section: https://www.hostinger.es/tutoriales/.
  • Specific article: https://www.hostinger.es/tutoriales/como-crear-una-pagina-web/.
  • Anchor to a section: .../como-crear-una-pagina-web/#6_Optimiza_tu_sitio_web_para_los_motores_de_busqueda.
  • Specific image: .../wp-content/uploads/2022/01/montar-tienda-online.png.

Notice how the path reflects the content hierarchy (category > article) and how the snippet allows you to jump to a specific tip within a long guide.

SEO best practices for creating and managing URLs

Designing the URL structure well from the beginning saves a lot of headaches. As the project grows, these are the most important recommendations:

Clarity, brevity, and relevance

A good URL describes the content concisely and without unnecessary words.You don't need to include the entire exact keyword phrase, but you do need to include the essential terms:

  • Best: /curso-google-ads-online
  • Worse: /curso-123456 o /c?=a1b2c3

Avoid filler words (“the”, “the”, and”…) when they do not add meaning and ensure that the user, just by reading the URL, can guess what they will find.

Proper use of keywords

url

Including the main keyword naturally in the URL helps reinforce relevance, both for the user and the search engine. Classic example:

/blog/que-es-una-url

It's not about filling the URL with keywordsbut to reflect the central theme of the page in a very direct way.

Recommended characters and separators

Whenever possible, avoid accents, ñ's, spaces, and special characters.because they tend to turn into unfriendly encodings (%C3%B1, %20, etc.).

  • Usa lowercase consistently.
  • Separate words with middle scripts -not with underscores or spaces.
  • Do not overuse special symbols or long, meaningless number strings.

Search engines interpret the hyphen as a word separator, which improves semantic understanding. of the URL content.

Logical structure by sections

Organizing the site into clear sections and reflecting that hierarchy in the URLs greatly improves navigation. and to tracking:

  • /blog/
  • /formacion/
  • /servicios/

Within each folder, use paths consistent with the type of content. (for example, /blog/seo/ for SEO articles, /servicios/desarrollo-web/ for programming services, etc.).

Avoid unnecessary URL changes

woman working on computer

A URL that is already ranked and receives external links is an asset.Changing it without a good reason is throwing away some of the accumulated authority.

If you have no other option but to modify it (due to restructuring, naming error, migration, rebranding, etc.), make sure to:

  • Setup 301 redirects from the old URL to the new one.
  • Update all internal links to point in the new direction.
  • Check that no unnecessary redirect chains are generated.

Parameter control and duplicate content

In online stores and large websites, parameters are one of the biggest sources of SEO problems.Each filter, order, or combination can generate a different URL for the same product listing.

Best practices for keeping chaos under control:

  • Limit the number of parameters that actually need to be indexable.
  • Define Canonical URLs for the main versions of categories and products.
  • Configure in tools like Google Search Console how certain parameters should be handled.
  • Lock in robots.txt combinations that add nothing (infinite calendars, redundant filters...).

Use subdomains and redirects wisely

Using subdomains like “blog.” or “shop.” has organizational advantages, but it also means managing them almost as separate projects.It's not always the best option for SEO; often it's preferable to keep everything under the same domain and subfolders.

301 and 302 redirects are basic tools in any migration:

  • 301 for permanent URL changes.
  • 302 for temporary redirects (tests, maintenance, one-off campaigns).

A correct implementation preserves the user experience and transfers much of the SEO authority. to the new addresses.

URLs are much more than just addresses; they are the backbone of your site's information architecture.Designing them thoughtfully, respecting their syntax, understanding their types, and applying good SEO practices will make the difference between a project that is easy to crawl, usable, and scalable, and a labyrinth of parameters, duplicates, and redirects that hinders your visibility and complicates every change you want to make in the future.