Routing with traditional URL paths instead of the hashbang convention

The !# convention for URLs used by Webix Jet has been deprecated since 2010, because pushState is a better option, and has browser support across the board, except for IE8 and Opera Mini (for which the !# trick can be used as a fallback).

Twitter dropped the !# in 2012.

How can we use regular URL routing with Webix?

The hash based routing is the only one which can be used without special handling on a server side. pushState solves problem with URLs on a client side. When user reloads a page, or opens a link in a new tab, server side will need to redirect the used address to the index page. It is easy to do, but still, it adds an extra step for creating an app.

Technically, it is possible to switch the routing code and use a traditional URL or any other pattern. I will post the example in next few days.

has been deprecated since 2010

Not really. It is not used by Google for ajax web crawling anymore, but still is a valid approach.

Using hashbangs works, but can also create to the customer the impression of an old application, since they’be been dropped by Twitter, Facebook and other popular web apps.

Thank you in advance for the example showing how to use real URLs.

Turns out Backbone can be configured to use “real URLs” by setting pushState: true:

Backbone.history.start({
      pushState: true,
      root: '/'
    });

The problem is that

Using the API gives you cleaner URIs but they come with a cost. Unlike with hash fragments your route URIs must exist. When the client enters a page, say http://example.com/products/1234/details, the web server must respond with something meaningful, i.e. an actual page containing the JavaScript application. What you probably want is to respond with http://example.com/products/1234#details.

If you’re after a single-page application you can not use plain old <a href="/bar/baz"> tags for navigation anymore. When such link is clicked, web browsers try to ask for the resource from server which is not of course desired for a single-page application. Instead you need to use e.g. click handlers.

Just found a post from Google explicitly advising against using fragment-based routing:

Avoid using “#” in URLs (outside of “#!”). Googlebot rarely indexes URLs with “#” in them. Use “normal” URLs with path/filename/query-parameters instead, consider using the History API for navigation.

I’m interested in traditional URL pattern, is there some solution?

Thanks.

@Sgobbit solution will be released in the upcoming Jet update with the Webix 5.0