URL片段:在你的哈希的URL开头的斜杠' - 好还是坏? [英] URL fragments: a leading slash in your hash url - good or bad?
问题描述
只需要知道它是否是一个好还是不要有在你的哈希网址一个斜线。例如,
Just need to know whether it is a good or not to have a leading slash in your hash url. For instance,
site.come/#/directore/file/
或
site.come/#directore/file/
我问这个,因为Backbone.js的不建议第一个选项中的文档(我个人preFER第一个选项...),
I am asking this because backbone.js does not recommend the first option in their docs (personally I prefer the first option...),
http://backbonejs.org/#Router-extend
请注意,你会希望避免在您的路线使用斜线
定义
Note that you'll want to avoid using a leading slash in your route definitions
所以,我要确保是什么原因背后,你要避免使用斜线
。
So I want to make sure what the reasons are behind this that you want to avoid using a leading slash
.
推荐答案
我觉得这两种方法都是不好的,如果网站应该是公开的,因为它会伤害搜索引擎优化。
I think both methods are bad if the website should be public, as it would hurt SEO.
Conisder使用#!
如谷歌的指示人做这样的网站是抓取
Conisder using #!
as google instructs people to do so that the website is crawlable
这篇关于URL片段:在你的哈希的URL开头的斜杠' - 好还是坏?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!