Search code examples
jquerybackbone.jstrailing-slash

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/

or

site.come/#directore/file/

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.


Solution

  • I think both methods are bad if the website should be public, as it would hurt SEO.

    Conisder using #! as google instructs people to do so that the website is crawlable