What makes a “friendly URL”?

后端 未结 20 1752
伪装坚强ぢ
伪装坚强ぢ 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条回答
  • 2020-12-02 05:37

    The "unfriendly" URL you show exposes an implementation detail: what if, sometime in the future, you decide to drop ASP and to use something else? You would have to change all the URLs (baad!) or to employ a renaming scheme.

    Having the title repeated in the URL is maybe not that necessary but it turns out handy when you do a lot of link pasting, to double check that you are linking to the correct place.

    0 讨论(0)
  • 2020-12-02 05:37

    Our website uses so-called 'unfriendly' URLs, but we create special 'friendly' URLs for specific locations that members of the public use for specific functions, especially on printed material.

    For example, our parking tickets have http://www.dnv.org/parking on them.

    CP

    0 讨论(0)
  • 2020-12-02 05:37

    Thematically linked inner pages that logically work within each other. That is the best way to Silo a URL structure.

    The best example, without using client websites would be to look at the BBC website, this has been done in best practice:


    www.bbc.com/
    www.bbc.com/news
    www.bbc.com/news/world
    www.bbc.com/news/world/australia

    Inner pages have been correctly organised. This is best practice to tell the search engines how to move around the website.

    0 讨论(0)
  • 2020-12-02 05:39

    There seems to be a lot of conflicting information about precisely what effect querystring have on crawlers, but the consensus is that having more than a couple parameters harms your SEO because a long querystring variable indicates dynamic content, and so most search engines will be a lot less aggressive indexing your page.

    Adding a slug to your url, such as this-is-the-name-of-my-blog-post from your example, also makes your links more different from one another than a simple id number, and adds more significant words into the url. These are all things that search engines look for.

    Personally I find such urls much easier parse visually because there are fewer punctuation characters used, and the name-value pairs in the querystring can be very verbose and hard to remember.

    0 讨论(0)
  • 2020-12-02 05:41

    In this situation, it doesn't really break the DRY principal, because as far as a search engine is concerned, '522466' is not the same thing as 'what-makes-a-friendly-url'

    Generally for sites like StackOverflow, the token is the only piece of information that matters; usually you can put whatever you want after that point and it'll take you to the same place (ignored by the web server).

    The page description is only there to help the search engines identify what the page is about (which is nice)

    0 讨论(0)
  • 2020-12-02 05:42

    My thoughts on your three bullets:

    • I'd say that's not an optimal URL. I have no idea why one would show both the post identifier and title. I don't ever include post IDs in my URLs at all, only titles and (sometimes) dates
    • For users, shorter is better.
    • Search engines look at the url. Whether it makes sense or not, they do. Having keywords in the URL will offer some SEO benefit.
    0 讨论(0)
提交回复
热议问题