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 7773025
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T17:01:21+00:00 2026-06-01T17:01:21+00:00

I’m trying to do something pretty simple. Here’s the scenario: I have a whole

  • 0

I’m trying to do something pretty simple.

Here’s the scenario:
I have a whole site working great with pushstate enabled browsers. The site works off the basis that the language is the “actual page” for instance:

/en/whatever/etc  = index.en.php with  with english headers and encoding & tweaks
/ar/whatever/etc  = index.ar.php with  with arabic headers and encoding & tweaks
/ru/whatever/etc  = index.ru.php with  with russian headers and encoding & tweaks

It’s really slick and works nicely with pushstate as I mentioned. The problem is when I try to use the same router code with the hash alternative.

Backbone’s router seems to want to do this:

/#/en/whatever/etc = bad because it's not based correctly
/#/ar/whatever/etc = and so on

what I want it to do is:

/en/#whatever/etc
/ar/#whatever/etc
/ru/#whatever/etc
..and so on

or even:

/en/#/whatever/etc
/ar/#/whatever/etc
/ru/#/whatever/etc
..and so on

But i can’t find a way without tweaking backbones source to implement this. I’m kind of against changing backbone.js unless I really have to because of the futureproofing factor.

Anyone have any thoughts?

  • 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-01T17:01:23+00:00Added an answer on June 1, 2026 at 5:01 pm

    You need to use the root option in the Backbone History object:

    Quote the docs:

    If your application is not being served from the root url / of your domain, be sure to tell History where the root really is, as an option: Backbone.history.start({pushState: true, root: "/public/search/"})

    You’re going to have to do some code that happens on your landing page that looks at what language they’re using, and then sends them to /[LANG CODE]/. Then on your server, you just map requests for /[LANG CODE]/ to your .html file.

    In your HTML file look at the location.pathname variable, strip off the first /[LANG CODE]/ part and use that as your root value for the options hash.

    var lang = "/"+_.first(location.pathname.split('/')+"/";
    Backbone.history.start({pushState: true, root: lang}); // if you're using pushState, otherwise omit or set to false
    

    This will cause your URLs to be:

    /en/#whatever/etc
    /ru/#whatever/etc
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have just tried to save a simple *.rtf file with some websites and
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a French site that I want to parse, but am running into
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I am trying to loop through a bunch of documents I have to put
Basically, what I'm trying to create is a page of div tags, each has
I am trying to understand how to use SyndicationItem to display feed which is
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
this is what i have right now Drawing an RSS feed into the php,

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.