How come some site urls do not include a file extension?

后端 未结 13 1725
终归单人心
终归单人心 2020-11-28 09:38

I was browsing the internet and noticed, YouTube, for example, contains a URL like this to denote a video page: http://www.youtube.com/watch?v=gwS1tGLB0vc.

13条回答
  •  借酒劲吻你
    2020-11-28 10:27

    When you ask 'Why?' are you asking for a technical reason or a design reason? Some people already answered the technical so I'll just comment on the design.

    Basically it boils down to that url is an endpoint. It's a place that users/services need to get to. The extension is irrelevant in most cases. If a user is browsing the web and goes to http://site.com/users he is expecting a list of users. He doesn't care that it doesn't say .html or .php. And as a designer using those extensions doesn't really make sense. You want your app to make sense, and those extensions aren't really providing any insight that the user needs.

    Times that you would want to use them were if you were creating a service that other applications would use. Then you could choose to use an extension to denote what kind of data one could expect to get back (.json, .xml, etc). There are people working on design guidelines and specs for this stuff, but it's all early

    Basically those extensions are used because that's how web servers/clients worked by default. As web development has matured we started treating urls more professionally and tried to make them make sense to people reading/using them.

提交回复
热议问题