Note that there are some explanatory texts on larger screens.

plurals
  1. POBackbone.js making router seo friendly
    primarykey
    data
    text
    <p>I am new to backbone.js so this may be an easy question.</p> <p>The router seems to use semantically sensible urls, but they aren't very user friendly.</p> <p>In the examples I've seen they use:</p> <blockquote> <p>local.com/post/id/1</p> </blockquote> <p>But in wordpress I would opt to rewrite this as:</p> <blockquote> <p>local.com/2012-11-03-backbone-js-router-question.html</p> </blockquote> <p>This would be run through a big rewrite table and translated to the right controller/action. I don't want to expose the router to the user that prominently. </p> <p>My final application for this question is with e-commerce in mind:</p> <ul> <li><strong>cms page</strong> local.com/about-us.html</li> <li><strong>product page</strong> local.com/blue-tooth-headset.html</li> <li><strong>category page</strong> local.com/phones.html</li> <li><strong>product via category page</strong> local.com/phones/blue-tooth-headset.html</li> </ul> <p>So my question is, <strong>how would one get pretty urls while using backbone.js?</strong></p> <p><strong>My thoughts on options are:</strong></p> <ol> <li>You don't get seo friendly urls</li> <li>You have some enormous map, and it has to sit on the client :(</li> <li>Everytime you are about to change the url you have a quick ajax lookup up for the pretty-url, and you need to wait for the pretty-url to come back before you pushState.</li> <li>sections are prefixed with a letter ie local.com/p/product-name.html and p actually serves to distinguis which router, another could be c for category</li> </ol>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload