Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8784871
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T21:12:44+00:00 2026-06-13T21:12:44+00:00

I am new to backbone.js so this may be an easy question. The router

  • 0

I am new to backbone.js so this may be an easy question.

The router seems to use semantically sensible urls, but they aren’t very user friendly.

In the examples I’ve seen they use:

local.com/post/id/1

But in wordpress I would opt to rewrite this as:

local.com/2012-11-03-backbone-js-router-question.html

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.

My final application for this question is with e-commerce in mind:

  • cms page local.com/about-us.html
  • product page local.com/blue-tooth-headset.html
  • category page local.com/phones.html
  • product via category page local.com/phones/blue-tooth-headset.html

So my question is, how would one get pretty urls while using backbone.js?

My thoughts on options are:

  1. You don’t get seo friendly urls
  2. You have some enormous map, and it has to sit on the client 🙁
  3. 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.
  4. 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
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T21:12:45+00:00Added an answer on June 13, 2026 at 9:12 pm

    Backbone routes can be mostly anything. About e-commerce, you’d just need to use wordy urls:

    <category>/<product-name>
    television/samsung-i178
    

    But, that’s not really what you should matter about regarding SEO. Google mostly added way less value in URLs keyword after last year “panda” update.

    What you should really consider is getting fallback and content served on the page even if javascript isn’t enabled. But the trouble there is that you probably don’t want to code your site twice: frontend templating/paging engine + plus same thing on the backend.

    There’s upcoming technologies who’ll help leverage this problem using node.js (Mojito, Meteor, etc), but right now they’re not the most stable projects out there. And, I think it may be a little early to use these in production; if you don’t have a really competent team to get you server going and debug those projects if needed.

    Anyway, what I mean is that if SEO weight a lot in your project, just don’t use backbone.

    Edit :
    About what you add to your question, I think that’s pretty easy to conceptualize.

    In Backbone, you use a variable router, like so:

    routes: {
      "product/:url" : "product" 
    }
    
    product: function( prettyUrl ) {
      console.log( prettyUrl );
    
      // Then you fetch your server
      server.fetch( prettyUrl );
    }
    

    Then on your server database, you just fetch your database by the product pretty url, like SELECT * FROM product WHERE prettyurl=$prettyURL (Or something similar to this, been a long time since I used mySQL).

    This way, you don’t have to keep a map on the client side, you only use the pretty url the server gave you to fetch full product.

    So when on your collection you call fetch, the server should return to you:

    {
      id: 1,
      name: "Product XYZ",
      prettyUrl: "product-xyz"
    },
    {
      id: 2,
      name: "Mac Book Pro",
      prettyUrl: "mac-book-pro"
    }
    

    This way, every pretty url is managed with his model, not in the router. And that’s definitely the way to go to manage such URLs. And that’s mostly how does it any WordPress or Drupal out there. Only they do it on the backend side.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm really new to backbone so the question may seem a bit naive. But
I'm pretty new to Backbone so excuse me if this question is a little
I've seen this question regarding inheritance in Backbone: Backbone.js view inheritance . Useful but
This may be a javascript 101 or Backbone 100 questions. But I feel comfortable
I'm using the router function in backbone.js and came across this problem. This may
Fairly new to backbone, so this is a really basic question. I have a
This may be a general javascript or jQuery question- I'm using backbone.js and I'd
I'm sure this is obvious but I am new to backbone.js and have wasted
I'm very new to backbone but I manage to get it working from tutorial.
I'm new to backbone.js and I've read other solutions to similar problems but still

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.