LebGeeks

A community for technology geeks in Lebanon.

You are not logged in.

#1 April 27 2011

rolf
Member

Ajax-based web apps and URL

Hi,
I'm researching useful URLs for web apps. As web apps run on a single page (in the conventional meaning), the URL does not change by itself as you navigate within the application. This is negative point for SEO, and for visitors since it does not allow you to bookmark and share a single "page" (more precisely a "state") as you would with traditional sites.
Did a little research, and read about using hashes in the URL, like for example:
http://www.mysite.com/myapp/#state41
You can add those through javascript without triggering a reload of the page. So now individual states can be bookmarked, and the user can come back later to a page he bookmarked.
But I then remembered seing something that left an impression on github... and sure enough, here it is... check it out in the browse files interface, for example here:
https://github.com/voloko/ukijs.org
(BTW, uki is really an interesting project, IMHO. It has some maturation to go, though)
Try browsing the folders... this is obviously ajax-based (and Firebug confirms that)... but check out the URL... it changes! And I don't mean the hash part... all of it!
I thought that was impossible, due to (very understandable) security concerns. So how do they do that??
Any ideas? I might look closer at it but right now I don't have that much time.

Last edited by rolf (April 27 2011)

Offline

#2 April 28 2011

jsaade
Member

Re: Ajax-based web apps and URL

The only problem with hashes is that they are not SEO friendly (google bots do not go into URLS with hashes).
usually you need to have some kind of .htaccess configuration for the URL:
www.example.com/test -> www.example.com/#test
have a look at jQuery address library
(If you ever been into flash SEO you migh know of its sister library SWFAddress).

for github it uses HTML 5 history API:
http://stackoverflow.com/questions/5607 … javascript

Offline

#3 April 28 2011

arithma
Member

Re: Ajax-based web apps and URL

It's worth noting that google bot will not see the content that javascript will generate.
It will show the content prior to the execution of javascript, IIRC.

Last edited by arithma (April 28 2011)

Offline

#4 April 28 2011

jsaade
Member

Re: Ajax-based web apps and URL

you can have a mod_rewrite to a file that service content for SEO
ie:
example.com/test => example.com/seo.php?url=test
seo.php just generate info for the URL 'test'

Offline

#5 April 28 2011

arithma
Member

Re: Ajax-based web apps and URL

Are you talking about servicing different content to a googlebot than other agents?

Last edited by arithma (April 28 2011)

Offline

#6 April 28 2011

jsaade
Member

Re: Ajax-based web apps and URL

jQuery address actually does that (service googlebot than other agents).

the thing is that whatever you do, being an ajax app it wont be SEO friendly unless you manage to detect the user-agent and redirect accordingly.

Offline

#7 April 28 2011

rolf
Member

Re: Ajax-based web apps and URL

ZeRaW wrote:

for github it uses HTML 5 history API:
http://stackoverflow.com/questions/5607 … javascript

Oh.. OK.. that explains it :) Thanks!

Last edited by rolf (April 28 2011)

Offline

#8 April 28 2011

arithma
Member

Re: Ajax-based web apps and URL

@ZeRaW: Digging a little deeper shows that it's more involved than just having a JS handle the redirection for googlebot (which would be insanely difficult for them to implement). The concept of HTML snapshots is preserved along with jQuery Address (from what I collected, the process has been made into like a protocol where each hash address can be mapped to a regular http link that the googlebot will crawl).
Your best bet as a webmaster is to see fetch what the googlebot sees and checkout the results.

Offline

#9 April 28 2011

rolf
Member

Re: Ajax-based web apps and URL

arithma wrote:

Are you talking about servicing different content to a googlebot than other agents?

I think he is. Is that acceptable/good practice?
I'm thinking there is potential to abuse this method (to boost page-rank or whatever), so maybe this will be depreciated or something... On the other hand, it's not practical to expect google bot to parse Flash, Javascript, and whatever new web specifications and extract information from them...

Last edited by rolf (April 28 2011)

Offline

Board footer