What is the best long-term URL design?

I like URLs - particularly forms:

  • / questions / {Id} / {Title}
  • / users / {Id} / {Name}

This is great because as the name of the question changes, search engines will use the new URL, but all the old URLs will work.

Jeff is mentioned in one of the podcasts - at the time the Flair function was announced - that he regretted some of the design decisions he made when it came to these forms. In particular, he was disturbed by his pseudoglands, as in:

  • / users / edit / {Id}
  • / posts / {id} / edit

It was a little incomprehensible which of these forms of the verb he preferred.

Which template do you prefer (1 or 2) and why?

+3
source share
6

2 , URL- . :

  • " EDIT , ID"
  • " POSTS, ID EDIT "

URL-, URL- .

  • , get/users/edit... ? ? !
  • , /posts/id... , , ID ? .

2 !

+8

, # 2.

, , . :

/users//4534905

, ,

/user/4534905/

. , .

/user/4534905/edit
+2

. - URL- . , . :

/question/how-do-i-bake-an-apple-pie
/user/frank-krueger
+1

2:

:

/questions/foo == , "foo"
/questions/{id}/foo == "foo"

/users/aiden == ,
/users/{id}/aiden == ,
/users/aiden?a=edit /users/aiden/edit == Aiden?
/users/{id}/edit /users/{id}?a=edit

/rss/users/aiden == RSS- aiden
/rss/users/{id} == RSS-
/rss/users/{id}/aiden == RSS- Aiden

GET , /x/y/z , GET/POST/PUT .

2p

+1

.

, URL- , . URL :

/posts/42 
/posts/42-goodbye-and-thanks-for-all-the-fish

URL- , , , . , URL- - .

+1
/ question / how-do-i-bake-an-apple-pie
/ question / how-do-i-bake-an-apple-pie-2
/ question / how-do-i-bake-an-apple-pie -...
0
source

Source: https://habr.com/ru/post/1712591/


All Articles