Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

These are my URL rules, in any project where I or my clients violate one of the rules - or their priority, we will regret it down the road.

URL-rules

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 (equals 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 (partial) of the targeted phrase

URL-Rule 1 is more important than 1 to 6 combined,

URL-Rule 2 is more important than 2 to 6 combined,

URL-Rule 3 is more important than 3 to 6 combined,

URL-Rule 4 is more important than 4 to 6 combined.

URL-Rule 5 and 6 are a trade-off. 6 is the least important.

A truly search optimized URL must fulfill all URL-Rules.

My preferred URL structure is:

https://www.example.com/%short-namespace%/%unique-slug%

https:// – protocol

www – subdomain

example – brand

.com – general TLD or country TLD

%short-namespace% – one or two letters that identify the page type, no dependency to any site hierarchy

%unique-slug% – only use a-z, 0-9, and – in the slug, no double — and no – or – at the end. Only use “speaking slugs” if you have them under your total editorial control.

i.e.:

https://www.example.com/a/artikel-name

https://www.example.com/c/cool-list

https://www.example.com/p/12345 (does not fulfill the least important URL-Rule 6)

https://www.example.com/p/12345-product-name



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: