URLs should be structured so that they are not just user friendly but also SEO friendly. What does that mean? Keep reading on to find out.
I've audited websites where use of certain characters in URLs has resulted in duplicate content (e.g. ç encoded to %C3%A7 - so the URL that originally included the ç character also exists with %C3%A7) and where characters (often with diacritics) have led to 404 Not Found or other server errors. On one website, PDF filenames led to most PDFs returning 404 Not Found.
URLs should also be structured so they are easy to read.
SEO-friendly URLs are generally user-friendly URLs.
There are many characters URLs can and cannot contain, but to be straightforward in preventing any issues, LoveUX recommends using only (the same applies to website files such as images and PDFs):
Hyphens pasted from software such as Word can be encoded incorrectly, so ensure any software used doesn't change the hyphen from how it would be typed from a keyboard.
Depending on the technical purpose of the URL, some other characters are used e.g. example.com/category/subcategory?colour=red&size=large:
Avoid using these characters in a URL outside of the above context e.g. avoid using ampersands as follows:
example.com/womens/jackets-&-coats
Avoid using file extensions in URLs e.g:
example.com/category/subcategory.html
example.com/category/subcategory.php
It's usually straightforward to remove file extensions from URLs in the CMS or for a web developer to create a rule to remove them.
Removing file extensions from images (e.g. .jpg) and PDFs isn't common and given they can set expectations (e.g. you know you're downloading a PDF if the URL ends in .pdf) it may be best to leave them intact - and it doesn't seem like PDFs will be superseded any time soon, meaning those URLs should remain intact for the foreseeable future.
Google heads up their advice on URLs with "Simple URLs convey content information."
URLs should be short but descriptive. They should be constructed in a way that is predictable with folders (separated by a forward slash) that match the hierarchical structure of the website.
A website's category structure and navigation are very important and should be finalised to inform the URL structure.
The below examples are best practice when creating new URLs and doesn't necessarily mean we recommend changing existing URLs, where other technical implications would need considering (such as whether old URLs need redirecting to new URLs).
E.g. from
example.com/womens
We expect the page to show the womens' products that particular website specialises in and would expect there to be a mens URL at
example.com/mens
E.g. for subcategories
example.com/womens/coats
we expect the page to display womens' coats and would expect the mens coats URL to be
example.com/mens/coats
The same applies when filtering content e.g. for black Patagonia jackets:
example.com/women/coats?brand=patagonia&colour=black
Example for sorting by price filter:
example.com/women/coats?price=asc
Avoid repeating keywords, which make URLs unnecessarily long and more difficult to read e.g:
example.com/women/womens-clothes/womens-coats
Sometimes it works well, but adding product names to a category and subcategory URL can cause problems when products appear in more than one category and make URLs longer than necessary e.g:
example.com/women/coats/women-torrentshell-3l-rain-jacket-classic-navy
The following shorter URL shows the information needed:
example.com/women-torrentshell-3l-rain-jacket-classic-navy
We generally recommend avoiding product codes in URLs unless they're used by target customers when searching for that product.
Blog URLs should follow the same pattern as the examples above.
E.g. blog homepage:
example.com/blog
Blog category:
example.com/blog/hiking
Blog article:
example.com/blog/cape-wrath-trail-hike
Avoid using dates where content is time sensitive. E.g. if an article is "the best something in 2021" and updated in 2022, avoiding the year in the original URL will avoid unnecessary redirects in future.
When separate websites are needed for multilingual and/or multi-regional reasons, assuming the domain extension isn’t region-specific (i.e. is .com or .org rather than .co.uk or .fr), I recommend using URL subfolders to specify the language and region.
E.g. for multilingual websites:
example.com (primary version, such as British or US English-language)
example.com/fr/ (separate French-language version)
example.com/cy/ (separate Welsh-language version)
E.g. for multi-regional and multilingual websites:
example.com/be/fr/ (Belgian French-language version)
example.com/be/nl/ (Belgian Flemish-language version (nl is the language code for Dutch and Flemish))
Pages on multilingual and/or regional websites should appear within the above folder structures, and URLs should be translated locally. E.g. the women’s section of a French-language version of a website:
example.com/fr/femme/
Recommended language codes are based on ISO 639-1. Country codes are based on ISO 3166-1 alpha-2 (remembering to keep these lower case for URLs; when using hreflang tags, language codes are lowercase but country codes are uppercase).
Bear in mind that every language or regional expansion of a website should be considered carefully for many reasons.
Web pages can be duplicated at multiple URLs e.g. the content from:
https://example.com/women/coats
could also appear at
http://example.com/women/coats
https://www.example.com/women/coats
https://example.com/women/coats/
https://example.com/women/coats.php
and combinations of the above.
Only ever link to one URL of a page.
It doesn't matter whether the chosen URL includes www or not, or includes a trailing slash or not, as long as the choice is adhered to sitewide. But URLs should be https with a website SSL certificate.
http URLs should be 301 redirected to https URLs with a pattern-matched rule. Similarly, 301 redirect one to the other of the favoured www vs non-www and trailing slash vs non-trailing slash URLs.
More information on redirects: https://developers.google.com/search/docs/advanced/crawling/301-redirects
Only use recommended characters in URLs.
Short and descriptive URLs are easy to read and understand for website visitors and search bots. Studies have shown descriptive and shorter URLs are more likely to be clicked and shared.
A page should only be available at one URL.
Once set, URLs should ideally not change. Make them best-practice once, and they will be best practice for years to come. If changing URLs is necessary, technical considerations include whether the old URLs need redirecting to the new URLs.