Ensure all subpath layers resolve in URLs
Published on under the Web category.Toggle Memex mode
I was just skimming the W3C "Style Guide for online hypertext" this morning and came across the "Cool URIs don't change" document. If you haven't read that post already, please take a moment to do so. My biggest takeaway from the document is that you should spend time thinking about how you want to structure URLs before you make a new site, or during a rearchitecture.
One principle I keep in the back of my mind when designing URLs is that all subpaths should resolve. Consider the following path, from the afore-linked W3C style guide:
https://www.w3.org/Provider/Style/URI
If I remove the URI
, I am taken to the full style guide. This is how I found the index of the style guide. I had already read the "Cool URIs don't change" document and I was eager to explore. If I were to offer one piece of feedback, Provider
is quite ambiguous, but it does still resolve! The URL takes you to a guide on putting information on the web. As a reader on the website, I can infer that URI
is part of Style
which is part of Provider
. There is a structure.
I like it when I can go to a website and remove parts of a URL to traverse the site content. I am definitely a power user when it comes to navigating the web; this isn't a pattern that most people will use.
I have tried, where possible, to adopt this pattern on my blog:
https://jamesg.blog/2023/09/04/background-music/
You can remove the /background-music
part of the URL above and you will be taken to a list of all blog posts I published on 2023-09, and so on. Date-based structures are a bit more difficult to intuit because they can be in several formats. The IndieWeb wiki has a comprehensive page on URL design that talks more about dates in URLs, among other URL topics. I have opted for the YYYY-MM-DD format.
Here's your web tip for the day: structure your URLs in paths that reflect the organization of the content on your website. Ensure that a user can trim sections from the end of a path and still have the resultant page resolve.
Responses
Comment on this post
Respond to this post by sending a Webmention.
Have a comment? Email me at readers@jamesg.blog.