问:使用无扩展名的URL中的利弊? [英] What are the pros for using extension-less URLs?

查看:150
本文介绍了问:使用无扩展名的URL中的利弊?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是使用无扩展名的URL中的利弊?

例如,我为什么要改变?

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

要...

http://yoursite.com/mypage

和是有可能有扩展名的网址的每一页?

更新:

是扩展名的网址,网站的安全性更好?


解决方案

原因扩展名的网址是,它是独立于技术。如果你想改变你的内容的呈现方式,你不必更改URL。

W3:酷的URI不要更改

文件扩展名

这是一个很常见的一种。 CGI,甚至是。html的的东西,这将改变。您可能没有使用HTML在20年的时间该页面,但您可能希望今天的链接,它仍然是有效的。使得链接到W3C网站不使用扩展的正规途径....


结论

保持的URI,使他们仍然会在2,20或200,甚至2000年围绕显然并不像听起来那么简单。然而,所有在Web上,网站管理员做决策,这将使它真正困难的自己在未来。通常情况下,这是因为他们使用的工具,其任务被看作是present在当下最好的网站,也没有人评估时,事情的变化将发生在什么环节。该消息在这里,然而,很多,很多事情是可以改变和你的URI可以而且应该保持不变。他们只能如果你仔细想想,你如何设计他们。

What are the pros for using extension-less URLs?

For example, why should I change...

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

to...

http://yoursite.com/mypage

And is it possible to have extension-less URLs for every page?

Update:

Are extension-less URLs better for site security?

解决方案

The reason for extension-less URLs is that it is technology independent. If you want to change how your content is rendered you do not have to change the 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.

这篇关于问:使用无扩展名的URL中的利弊?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆