My SPA employs the Backbone.js router which uses pushstate and hashed URLs as a fallback method. I intend to use Google's suggestion for making an AJAX web-app crawlable. That is, I want to index my site into static .html files generated by PhantomJS and deliver them to Google via the URL:
mysite.com/?_escaped_fragment_=key=value
.
Keep in mind that the site does not serve static pages for end-users (it only works with a Javascript-enabled browser). If you navigate to mysite.com/some/url
the .htaccess file is setup to always serve up mysite.com/index.php
and the backbone router will read the URL in order to display the JavaScript-generated content for that URL.
Furthermore, so that Google will index my entire site, I plan on creating a sitemap which will be a list of hashbang URLs. The URLs must be hashbanged so that Google will know to index the site using the _escaped_fragment_key URL.
Soooo....
(1) Will this approach work?
and
(2) Since backbone.js does not use hashbang URLs, how can I convert the hashbang URL to the pushstate URL for when the user arrives via Google?
reference: https://stackoverflow.com/a/6194427/1102215