Friday, April 13, 2007

Clean URLs and AJAX

I have been perplexed for a while when starting to develop a new web application. I wanted to implement clean URLs in it, because clean URLs are the buzz these days. Actually I wanted to use clean URLs to make my web application more user and search engine friendly which would help in SEO as well as make the application look cleaner and neater.

AJAX is another hot topic these days which I did want to make use of in my application. The interesting thing is that by default an AJAX based application does not change its URL while the user interacts with it. Gmail uses AJAX extensively and its URL never changes.

Those two concepts, clan URLs and AJAX seemed to collied with one another at first. Then after some research and thought I came up with the logical conclusion. For parts of your web site which you want search engines to see and index and which you want your users to be able to bookmark and exchange its link with others, use clean URLs. For other parts of your application where a user interacts with the system to display specific information for that user as a result of his or her interaction with the system, then use AJAX for such parts of the system and do not change the URL while the user interacts with the system.

I came across this interesting wiki about unique URLs which discusses in some detail how to use AJAX while at the same time making your web application have more than a single URL so that people can bookmark specific parts and search engines can index those parts as well.