Hacker News new | ask | show | jobs
by franze 3929 days ago
my battle-proven URL rules. important: rule 1 is more important then rule 2 to 6 added up, rule nr 2 is more important than rule 3 to 6 totaled, rule 3 is more important than 4 to 6 together, rule 4 is more important than 5 + 6, rule 5 and rule 6 are a tradeoff (it's short, not shortest possible URL).

the targeted phrase is term(s) you want to get found for (i.e.: in google search)

URL-Rule 1: unique (1 URL == 1 resource, 1 resource == 1 URL)

URL-Rule 2: permanent (they do not change, no dependencies to anything)

URL-Rule 3: manageable (measurable, 1 logic per site section, no complicated exceptions, no exceptions)

URL-Rule 4: easily scalable logic

URL-Rule 5: short

URL-Rule 6: with a variation of the targeted phrase

most common mistake, rule 6 (least important) invalidates rule 1 (most important)

i stand with these url-rules, evertime you compromise on them - or change the priority in between the url-rules, you - your company/startup/business/website/webapp - will regret it in the longterm.

about: >This is the sort of solution that I really like. The SEO folks can fiddle with the URL until the cows come home, the engineers have the luxury of a straightforward rule, and the user never sees a broken link. Is this simple structure enough to keep everybody happy?

NO

every redirect has a cost:

- server ressources

- (web)performance a.k.a. speed

- long term project costs: redirects needs to be maintained (they will not) and documented (they are not)

- added complexity (redirect complexity add up fast, more info see https://news.ycombinator.com/item?id=8891553 )

1 comments

> every redirect has a cost:

If you are actually just keying your content lookup on the ID and don't redirect the user, what's the performance problem?

And use rel=canonical so search engines do the right thing.

no

simplified google works like this

discovery (queue) -(quality check)-> crawling(optional) -QC-> indexing

google does not "follow" canonicals, but whenever google discovers (during crawling) a canonical it pushes it back to the discovery queue -> needs to crawl again -> needs to figure out indexing

canonical is an indexing directive

so basically there are two quality checks before google can actually apply the indexing directive after it has discovered the canonical during crawling. also you can never be sure when - if ever - it will fetch the canonical URL or choose to canonical it.

for small sites this is not a big an issue (you will have internal duplicate pages for google for an unknown amount of time, but at one point they will probably be canoncalized). for big sites with millions and millions of URLs this is a big issue. basically in your example is the worst case: URL rule 6 (least important) breaks rule nr 1. then why do it at all

additionally to communicate different URLs to the users (based on the way which they came to your site) which is just bad UX.

don't do it.