Live data from Hacker News

Choosing between names and identifiers in URLs

cloudplatform.googleblog.com

71–80 of 157 posts

Re: Choosing between names and identifiers in URLs

#71

"The downside of the second example URL is that if a book or shelf changes its name, references to it based on hierarchical names like this one in the example URL will break." The author appears to have forgotten about 3xx redirection codes which were intended to solve that very problem.

But have been abused for black SEO and now are considered suspicious by search engines so we use them sparingly. This is why we can't have nice things.

What? 301s are the standard way to create redirects. That has nothing to do with blackhat SEO.

The small dip caused by 301s was even recently removed altogether.

Re: Choosing between names and identifiers in URLs

#72
post #3

Great post - I quite like the stackoverflow.com style of `stackoverflow.com/questions/ / `, where can be changed to anything, and the link still works. This allows for easy URL readability, while also having a unique ID. In the context of this post (the library example) that would look like library.com/books/1as03jf08e/Moby-Dick/

Goodreads does something similar, which I also appreciate. An example: https://www.goodreads.com/book/show/22733729-the-long-way-to...

You can take off any of the words past the numeric ID and it still works just fine.

Re: Choosing between names and identifiers in URLs

#73
post #19
post #3

Great post - I quite like the stackoverflow.com style of `stackoverflow.com/questions/ / `, where can be changed to anything, and the link still works. This allows for easy URL readability, while also having a unique ID. In the context of this post (the library example) that would look like library.com/books/1as03jf08e/Moby-Dick/

Doing this means that: 1) there are now an infinite number of URLs for every one of your pages that may end up separately stored on various services (mitigated for only some kinds of service if you redirect to correct), 2) if the title changes the URLs distributed are now permanently wrong as they stored part of the content (and if you redirect to correct, can lead to temporary loops due to caches), 3) the URL is now…

One thing I find useful about slugs in URLs is it lets me see that I used the intended link when I paste it

Re: Choosing between names and identifiers in URLs

#74
post #19
post #3

Great post - I quite like the stackoverflow.com style of `stackoverflow.com/questions/ / `, where can be changed to anything, and the link still works. This allows for easy URL readability, while also having a unique ID. In the context of this post (the library example) that would look like library.com/books/1as03jf08e/Moby-Dick/

Doing this means that: 1) there are now an infinite number of URLs for every one of your pages that may end up separately stored on various services (mitigated for only some kinds of service if you redirect to correct), 2) if the title changes the URLs distributed are now permanently wrong as they stored part of the content (and if you redirect to correct, can lead to temporary loops due to caches), 3) the URL is now…

> 1) there are now an infinite number of URLs for every one of your pages that may end up separately stored on various services (mitigated for only some kinds of service if you redirect to correct)

No need to redirect, that's what canonical links are for:

https://developer.mozilla.org/en-US/docs/Web/HTML/Link_types

I don't disagree in that I mostly dislike URL slugs, too. Except for some hub pages ("photos", "blog", etc.), a numerical ID is more than enough. But the combination of ordering and display modes and filtering can still amount to a huge number of combinations, so canonical links are still needed - to have as many options for the user as possible and allow them all to be bookmarked, but also give search engines a hint on what minor permutations they can ignore safely.

I wish search engines would completely ignore words in the URL. If it's not in the page (or the "metadata" of actual content on pages linking to it, and so on), screw the URL. If it is in the page (and the URL), you don't need the URL. As long as they are incentivized, we'll have fugly URL schemes.

Re: Choosing between names and identifiers in URLs

#75
post #19
post #3

Great post - I quite like the stackoverflow.com style of `stackoverflow.com/questions/ / `, where can be changed to anything, and the link still works. This allows for easy URL readability, while also having a unique ID. In the context of this post (the library example) that would look like library.com/books/1as03jf08e/Moby-Dick/

Doing this means that: 1) there are now an infinite number of URLs for every one of your pages that may end up separately stored on various services (mitigated for only some kinds of service if you redirect to correct), 2) if the title changes the URLs distributed are now permanently wrong as they stored part of the content (and if you redirect to correct, can lead to temporary loops due to caches), 3) the URL is now…

[deleted]

Re: Choosing between names and identifiers in URLs

#76
post #19
post #3

Great post - I quite like the stackoverflow.com style of `stackoverflow.com/questions/ / `, where can be changed to anything, and the link still works. This allows for easy URL readability, while also having a unique ID. In the context of this post (the library example) that would look like library.com/books/1as03jf08e/Moby-Dick/

Doing this means that: 1) there are now an infinite number of URLs for every one of your pages that may end up separately stored on various services (mitigated for only some kinds of service if you redirect to correct), 2) if the title changes the URLs distributed are now permanently wrong as they stored part of the content (and if you redirect to correct, can lead to temporary loops due to caches), 3) the URL is now…

>>> the pretense that the URL should somehow be readable is increasingly difficult to defend

I think I have a defense for this. I consistently long press links on mobile to see the url before deciding whether to load the page or not. Just to see if I can be bothered.

Re: Choosing between names and identifiers in URLs

#77
post #57
post #24

Earlier quoted context omitted.

> For Canny, I wrote some awesome code that I'm proud of that turns a "post title" into a unique URL. Did you mean "slug"? What you are describing is a basic feature of most blogging software since the inception of blogs...

It's way more than that. – Automatically handling duplicates – Avoiding needing to include the unique ID in the URL – Updating the URL after editing the post – Redirecting previous versions to the new version

I think most blog platforms have that...

Re: Choosing between names and identifiers in URLs

#78
post #19
post #3

Great post - I quite like the stackoverflow.com style of `stackoverflow.com/questions/ / `, where can be changed to anything, and the link still works. This allows for easy URL readability, while also having a unique ID. In the context of this post (the library example) that would look like library.com/books/1as03jf08e/Moby-Dick/

Doing this means that: 1) there are now an infinite number of URLs for every one of your pages that may end up separately stored on various services (mitigated for only some kinds of service if you redirect to correct), 2) if the title changes the URLs distributed are now permanently wrong as they stored part of the content (and if you redirect to correct, can lead to temporary loops due to caches), 3) the URL is now…

1: so what? I use this for my blog (cryptologie.net) and this has never been a problem. Search engines handle that quite well.

2: no. The URL is not wrong. Rather it won’t describe the content perfectly anymore. If this is an issue you can attribute a new ID to your page.

3: that’s why you have url shorteners. But what’s wrong with a long url? And how does it complicates sharing it? To share you copy/paste the url. Nothing changed. And now the url describes the content! (That’s the reason we do it.)

4: that’s a good thing!

So yeah. I’ll keep doing this for my blog and I hope websites like SO keep doing that as well

Re: Choosing between names and identifiers in URLs

#79
post #4

Good advice. Interesting that Canonical URLs aren't mentioned. But the sheer arrogance of serving a webpage that doesn't render any text unless you execute their JavaScript really annoys me. It's not a fancy interactive web-app, it's a webpage with some text on it.

Loaded just fine with NoScript here.

I didn't get any text until I enabled JS (using uMatrix).

Re: Choosing between names and identifiers in URLs

#80
post #4

Good advice. Interesting that Canonical URLs aren't mentioned. But the sheer arrogance of serving a webpage that doesn't render any text unless you execute their JavaScript really annoys me. It's not a fancy interactive web-app, it's a webpage with some text on it.

I understand the frustration but you also understand that the vast majority of individuals render JS on the page and do not use text only browsers. It’s not worth the time to appeal to such a minority share of internet users.

That's a bit disingenuous though because that's not because of user choice. JS has the enviable position of being the only language blessed to have an interpreter in the browser and this decision and it's consequences are foisted upon you regardless of whether you wanted it or not.

That argument also doesn't address OP's complaint: regardless of whether everyone has JS and uses it, the page is only rendering text, why is JS even necessary? It's not a web app, it doesn't have any special functionality etc, it doesn't have any legitimate reason to use JS, but for whatever reason, we're forced to use it anyway.

Post reply on HN