What makes a “friendly URL”?

后端 未结 20 1934
伪装坚强ぢ
伪装坚强ぢ 2020-12-02 05:25

I\'ve read a great deal of discussion recently (both on this site and elsewhere) about \"friendly URLs\" but I\'m not sure what exactly makes a URL \"friendly\" and why we r

20条回答
  •  猫巷女王i
    2020-12-02 05:53

    In my opinion, IDs and UUIDs should never be part of the URL, never.

    1) Some NoSQL databases don't use IDs at all, they use UUIDs. UUIDs are long, portions are separated using dashes. Google will treat a dash like a words separator: that means your url will have 5 more useless keywords.

    2) A human being does not understand IDs or UUIDs. A person understands words and talking URLs.

    3) If the title changes you can simply make a redirect like WordPress does, like @TRiG pointed.

    4) Finally, remember to use a date, so you can discern between two articles having the same title and posted in a different year, month or day. For example you can have two reviews (first edition and second edition) of the same book.

    http://example.com/2013/02/11/data-mining-concepts-and-techniques
    

    and

    http://example.com/2011/05/23/data-mining-concepts-and-techniques
    

    5) A date will also help any user to figure out if the content is recent or is not.

    6) A date will add an important keyword to your URL: the year. Let's suppose I want see the most beautiful girls in the world, I will type in Google: "most beautiful girls in the world 2014". My url will be:

    http://example.com/2014/07/10/the-most-beatiful-girls-in-the-world
    

    7) Last but not least, Chrome caches the site you visited, so you can find the above site just typing in the address bar "girls".

提交回复
热议问题