#1
  1. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Aug 2004
    Posts
    603
    Rep Power
    141

    Ajax + Keep Browser History ... but what about SEO?


    Hello,

    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:

    mydomain.com/page1.html
    mydomain.com/page2.html
    mydomain.com/page3.html

    When clicking from page1 to page2 babbq will re-write the url as follows:

    mydomain.com/page1.html#url=page2.html

    if I go to page2 from page3 babbq will re-write the url as follows:

    mydomain.com/page3.html#url=page2.html

    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:

    mydomain.com/page2.html
    mydomain.com/page1.html#url=page2.html
    mydomain.com/page3.html#url=page2.html

    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?
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2012
    Posts
    10
    Rep Power
    0
    In HTML5 you can change the actual URL so there's no need for the hash hack:

    http://spoiledmilk.com/blog/html5-changing-the-browser-url-without-refreshing-page
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Aug 2004
    Posts
    603
    Rep Power
    141
    Originally Posted by Lenton
    In HTML5 you can change the actual URL so there's no need for the hash hack:

    http://spoiledmilk.com/blog/html5-changing-the-browser-url-without-refreshing-page
    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.

IMN logo majestic logo threadwatch logo seochat tools logo