Live data from Hacker News

Examples of Great URL Design (2023)

blog.jim-nielsen.com

111–120 of 163 posts

Re: Examples of Great URL Design (2023)

#111
Just remember to build localization into your URLs.

mysite.com/en-us/some-page mysite.com/en-ca/some-page

You can 301 redirect some locale to your "base" URL if you want.

mysite.com/en-us/some-page > mysite.com/some-page

But don't stress too much. Google doesn't really care about URL content any more. People on phones don't care what your URL says. It's at most desktop users, and devs.

Don't stress localizing your URLs...

mysite.com/fr-ca/some-page is just as good as mysite.com/fr-ca/une-page... and the former is a lot easier to tie into email marketing variables.

Just keep your sitemaps in the localized folder.

mysite.com/sitemap.xml... just a link to the various localized sitemaps.

mysite.com/en-us/sitemap.xml etc.

By keeping sitemaps in a localized folder, it'll make it a lot easier for yourself as you go to register your site with each market's locale.

If you just have to localize URLs... consider doing what Amazon does and just tie the URL to an ID.

https://www.amazon.com/Moen-One-Handle-Bathroom-Deckplate-84...

the above is the same as this... https://www.amazon.com/dp/B0CFYPTKF8

And you can put anything you want in the URL string, it just matches on the ID.

https://www.amazon.com/literally-whatever-you-want-here/dp/B...

“We use the words in a URL as a very very lightweight factor. And from what I recall this is primarily something that we would take into account when we haven’t had access to the content yet… [but] as soon as we’ve crawled and indexed the content there then we have a lot more information. And then that’s something where essentially if the URL is in German or in Japanese or in English it’s pretty much the same thing.”

- John Mueller, Google Search Advocate.

Re: Examples of Great URL Design (2023)

#112

Earlier quoted context omitted.

I guess this reflects a view of blogging that maybe is more what people today would use twitter or mastodon for, with lots of blogposts with the same title like "open thread" or "links for sunday". Today people mostly use blogs to publish essays, and then a slug based on the title should be sufficient, since you're not going to publish two essays with the same title. That's what substack uses.

I think the date is still extremely valuable. Knowing whether something is from last month or a decade ago makes a huge difference. It's also useful so that URL's can be sorted by date. Also, "you're not going to publish two essays with the same title" feels false. If you write 1,000 pieces and use short titles and tend to write about the same subjects, it feels extremely likely that you'll wind up repeating titles.

In fact, on my own blog, I have some recurring posts, e.g.,

https://www.dahosek.com/the-big-countdown/

https://www.dahosek.com/the-big-countdown-2/

https://www.dahosek.com/the-big-countdown-11/

Alas, the default URL scheme in Wordpress doesn’t include the date.

Re: Examples of Great URL Design (2023)

#113
post #29

I found Notion's URL schema interesting as well. They have to contend with renames of pages, reorganisation of the hierarchy and all that. So they have something like: notion.so/:account/Current-Name-of-Page-:pageid where the name changes if the page is renamed, but the redirect works, as the page ID is unchanged. In fact, one can just use notion.so/:account/:pageid and gets redirected to the right page, or even noti…

I've noticed that Confluence, Reddit, and a good number of news sites do the same thing. Usually the title segment is entirely ignored, meaning you can prank someone by changing the title part to something shocking, and it just redirects to the usual page, because the server only cared about the ID bit

The fact that so many sites do this (including "normie" news sites) shows that site designers clearly believe users want and expect "informational"/"denormalized" URLs, rather than /?id=123

Re: Examples of Great URL Design (2023)

#114

I like that GitHub supports file-like suffixes to get different views of the same content. https://github.com/torvalds/linux/commit/{hash} https://github.com/torvalds/linux/commit/{hash}.patch https://github.com/torvalds/linux/commit/{hash}.diff

I'm also a fan of the public keys extension:

https://github.com/${username}.keys

Re: Examples of Great URL Design (2023)

#115
post #29

I found Notion's URL schema interesting as well. They have to contend with renames of pages, reorganisation of the hierarchy and all that. So they have something like: notion.so/:account/Current-Name-of-Page-:pageid where the name changes if the page is renamed, but the redirect works, as the page ID is unchanged. In fact, one can just use notion.so/:account/:pageid and gets redirected to the right page, or even noti…

Why end with the id instead of doing it like SO, as per the example in the article?

Re: Examples of Great URL Design (2023)

#116
How about great email address design? Of course firstname@lastname.com is top tier. But there are some interesting hacks you can do, such as firstn@melastname.com if your last name domain isn't available.

Re: Examples of Great URL Design (2023)

#117
post #71

Earlier quoted context omitted.

While the slug helps someone know what they're opening before reading it, most apps have link previews which give you just enough information you need.

I dont know if I'm in the minority but I really dislike link previews the vast majority of the time. They take up too much space and offer to little value. In discord I often x out of the preview and I know lots of others who do too. Maybe on some sites it's fine but I feel like link previews need more modularity on size or something. Perbaps even configurable both host and client

You're not in the minority.

The information density of the preview has to match, if not exceed, that of the context in which it is provided. Most of the times it's a placeholder image with less text than the URL itself.

Re: Examples of Great URL Design (2023)

#118

Back when I was working on GOV.UK Verify we had URLs that looked something like /verify-passport for English and /cy/verify-passport for Welsh. I made the decision that if readable URLs was a design goal they should be readable in both languages, and ended up localising them all to (for example) /verify-passport and /gwirio-pasbort. No idea if anyone ever noticed, but sometimes it’s nice to sweat the small stuff.

This is important to do, in my opinion. You should not assume that non-English-speaking users all understand a little bit of English. It also confers some SEO benefits.

That being said, if the URL has a language code (/en/), it would be good to change the language code manually, and still end up on the right page. Sometimes the language switcher is really well hidden. However a visible language switcher is even better.

Re: Examples of Great URL Design (2023)

#119

Earlier quoted context omitted.

I think the date is still extremely valuable. Knowing whether something is from last month or a decade ago makes a huge difference. It's also useful so that URL's can be sorted by date. Also, "you're not going to publish two essays with the same title" feels false. If you write 1,000 pieces and use short titles and tend to write about the same subjects, it feels extremely likely that you'll wind up repeating titles.

I agree, but I think it's important to note that the date in the URL can also be misleading. For example, it's often assigned at time of creation. If that page or post gets updated years later, even if almost entirely rewritten, it still has the original date in the URL

> even if almost entirely rewritten, it still has the original date in the URL

If we're talking about blogs/news, they don't ever get almost entirely rewritten. The original publication is the only date that matters, and it matters a lot.

If we're talking about evergreen content like documentation, then of course you don't put dates in the URL. A small "last updated" on the page itself is appropriate there.

Re: Examples of Great URL Design (2023)

#120

Earlier quoted context omitted.

That's fine (and already common) for images, JSON, etc. But nobody wants webpage URL's that randomly end in .php, .htm, .html, .aspx, and so forth. That's just noise that is both gibberish and entirely irrelevant to the user.

.htm and .html is relevant just like .pdf and .zip etc etc But I agree about .php, .aspx and other extensions that are telling something about the server side. That’s irrelevant for the user.

> .htm and .html is relevant just like .pdf and .zip etc etc

it's _kind of_ relevant, if it weren't for the fact that the absence of any extension implies .html >99% of the time

Post reply on HN