为什么某些服务器技术默认不使用无文件页面扩展?
首先让我问一下 MVC 架构——ASP.NET MVC 和 Ruby on Rails。它们都不使用页面文件扩展名。这是否与 MVC 架构本机的某些内容有关,或者此功能是否在其他地方设置?
既然它不是 MVC 的工作方式,为什么其他技术不默认设置为不需要文件扩展名呢?例如,ASP.NET 可以设置为不需要文件扩展名,但默认情况下并非如此。
据我所知,在网络上拥有页面文件扩展名是没有用的,看起来这可能会流行,但为什么花了这么长时间?
First let me ask about MVC architecture- ASP.NET MVC and Ruby on Rails. They both don't use page file extensions. Does this have to do with something native to the MVC architecture or is this functionality set up somewhere else?
In the case that it isn't native to the way MVC works, why aren't other technologies not set up by default to not need file extensions? ASP.NET for example can be set up to not need the file extension, but isn't that way by default.
As far as I know, having page file extensions on the web is useless, it seems like that may be catching on, but why has it taken this long?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于微软平台,我认为这是因为自从复杂的操作系统存在以来,就一直存在扩展。 HTTP 协议最初仅用于提供静态内容,后来出现了 ISAPI 和 CGI。由于磁盘上的内容已经带有文件扩展名,因此您需要指定要提供服务的文件的文件扩展名(因为这是文件全名的一部分)。它就像一个基于 HTTP 的文件系统。
后来,当 CGI / ISAPI 出现时,扩展并不是真正需要的,但模式已经设定,并且被遵循。微软的平台是建立在扩展之上的。 IIS 使用它来了解通过哪些 ISAPI 扩展传递请求(.aspx 通过 aspnet_isapi)。
我不能谈论像 UNIX 这样的其他平台。
For the Microsoft Platform, I would think it was because ever since complex operating systems existed, there have always been extensions. The HTTP protocol was only used for serving static content at first, ISAPI and CGI came later. Since content was already on the disk with a file extension, you needed to specify the file extension to the file you wanted to be served (because that was part of the full name of the file). It was like a file system over HTTP.
Later, when CGI / ISAPI came along, the extensions weren't really required, but the pattern was set, and it was followed. Microsoft's platform was built on the extension. IIS used it for knowing which ISAPI extensions to pass the request through (.aspx goes through the aspnet_isapi).
I can't speak for other platforms like UNIX.