When you have a single page application (SPA) which contains mostly of JavaScript content that is loaded via Ajax google propose a guide on how to make such applications crawlable.
You have to use #! in your page fragments to make the fragments visible to the search engine.
www.example.com/ajax.html#!mainpage
Now, if you use the HTML5 PushState History API you can change the url to
www.example.com/ajax.html/mainpage
This url looks must nicer than the first one. Search engines can easily access the page since there is no hash bang # in the url. The problem is that it is still a JavaScript page the must be interpreted which search engines do not do.
- How can this ajax page be accessible to search engines?
- How does my server know if a search engine or a user browser tries to access the page?
I have the following ideas but no idea how to implement it or if there are any solutions.
- you can make a html snapshot of each ajax page that can be accessed by the search engine
- you can use some kind of ui less browser is accessed by the search engine, the ui less browser interprets the page and then returns the html content to the search engine