September 22nd, 2012, 04:16 AM
Ajax + Keep Browser History ... but what about SEO?
I am developing a website which every page is loaded with an ajax call. This means that "by default" the browser history is not updated when the user goes from one page to another. I found a jQuery plugin to solve this problem; jquery babbq.
I managed to implement this but I think there is a big problem in using this tool when considering search engine optimization.
The problem is here:
If my website has three pages:
When clicking from page1 to page2 babbq will re-write the url as follows:
if I go to page2 from page3 babbq will re-write the url as follows:
In other words with this simple example made of three pages page2 (or any other page) has three valid urls how they can be accessed:
First of all this means that traffic for one page will be divided on three pages and to my knowledge of SEO this is not right since google see the number of back links and the back links to the same page might not all be the same.
One can argue don't use it and loose browser history support. The problem is that you loose MORE THAN THAT. You loose the functionality to bookmark a page on your site. You loose the functionality to share content on facebook. This because without babbq going from page1 to page2 would let the url (shown at the top of the browser) the same;
i.e. if the url is mydomain.com/page1.html and you do an ajax call to load page2.html than the url of the page as shown by the browser would still be mydomain.com/page1.html. Anyone who wants to bookmark page2.html will indeed be bookmarking page1.html (the page that will be loaded when the bookmark is clicked). This is one big lost of functionality!!
Does anyone know what options do I have to solve this problem?
September 22nd, 2012, 09:31 AM
In HTML5 you can change the actual URL so there's no need for the hash hack:
September 22nd, 2012, 01:19 PM
Thanks, I plan to use the HTML5 solution for modern browsers and use bbq framework for old browsers, at least I limit the damage of having multiple urls for the same page.
Originally Posted by Lenton