php - 使用无扩展名 URL 的优点是什么?

标签 php asp.net xhtml seo sitecore

使用无扩展名 URL 的优点是什么?

比如我为什么要改...

http://yoursite.com/mypage.html
http://yoursite.com/mypage.php
http://yoursite.com/mypage.aspx

为了...

http://yoursite.com/mypage

是否可以为每个页面提供无扩展名的 URL?

更新:

无扩展名的 URL 是否更利于网站安全?

最佳答案

无扩展 URL 的原因是它独立于技术。如果您想更改内容的呈现方式,则不必更改 URL。

W3: Cool URIs don't change

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/

相关文章:

c# - 使用 Page.ClientScript.RegisterClientScriptBlock 不起作用

html - 在 div 标签中按标签设置样式

php - Codeigniter 奇怪的查询结果

php - 您可以再使用 PayPal Php SDK 进行直接信用卡支付吗?

javascript - 在 Panel/Div 对象下隐藏 iFrame

ASP.NET MVC - 母版页的代码隐藏

php - 从bash连接到远程PHP解释器

php - zend框架-如何将上传的文件保存为mysql中的blob?

.net - 使用 XLINQ 解析 XHTML 文件的库

css - #footer 文本中的列表项不会居中