使用无扩展名 URL 的优点是什么?
比如我为什么要改...
http://yoursite.com/mypage.html
http://yoursite.com/mypage.php
http://yoursite.com/mypage.aspx
为了...
http://yoursite.com/mypage
是否可以为每个页面提供无扩展名的 URL?
更新:
无扩展名的 URL 是否更利于网站安全?
最佳答案
无扩展 URL 的原因是它独立于技术。如果您想更改内容的呈现方式,则不必更改 URL。
File name extension
This is a very common one. "cgi", even ".html" is something which will change. You may not be using HTML for that page in 20 years time, but you might want today's links to it to still be valid. The canonical way of making links to the W3C site doesn't use the extension....
Conclusion
Keeping URIs so that they will still be around in 2, 20 or 200 or even 2000 years is clearly not as simple as it sounds. However, all over the Web, webmasters are making decisions which will make it really difficult for themselves in the future. Often, this is because they are using tools whose task is seen as to present the best site in the moment, and no one has evaluated what will happen to the links when things change. The message here is, however, that many, many things can change and your URIs can and should stay the same. They only can if you think about how you design them.
关于php - 使用无扩展名 URL 的优点是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2170745/