Friday, November 16, 2007

SEO with different server-side languages

This article sheds light on an important aspect of SEO, i.e clean URLs. How would you achieve clean URLs in few commonly used server-side languages like JSP, PHP, Ruby on Rails.

Let me start off with clean URLs; Dynamic websites use server-side languages to process visitor inputs and display results generated at real time. Often you might see the address bar of most of your famous web browsers growing really long. I tried to search something on Google and I got a long URL on my address bar.
[goto|http://www.google.com/search?hl=en&client=firefox-a&rls=org.mozilla%3Aen-US%3Aofficial&hs=rmk&q=urls&btnG=Search]

So what are all these weird words?
My techie brothers by now might have already guessed that these are parameters a page passes to the server to dynamically generate the next page you are navigating to. So if you lost then check this for a little intel on server-side coding. Search engines find it hard to index these pages that are dynamically generated. They love static pages, for example
www.domain-name.com/pages/Check-this-article.html

So lets quickly learn on how we could clean these URLs
You could use the POST method instead of GET, this would clean the URL; But the problem is that it would completely clean the URL... hahah for example
http://domain-name.com/search.php would simple direct you to http://domain-name.com/results.php
no parameters at all, but then the state of that page would be lost and just the default results.php page would be indexed.
You could use URL rewriting, this would be the best solution as it would still preserve the state of that page and index it. For example,
http://domain-name.com/search.php?query=finance
can be modified as
http://domain-name.com/search/finance
by using Apache's mod-rewrite.

So now we have modified the URLs, (I haven't explained how to do URL rewriting in detail as there a zillion tutorials on the net plus the official Apache tutorials) whats next?

Which Server-side language is the best for this?
You should consider the fact that the older a language is the harder it is to have clean URLs there. So lets compare
JSP - Advance configuration
ASP - Advance configuration
PHP - Intermediate configuration
ASP.net or the .net frame work - Rather simple
Ruby on Rails - No configuration already done by the system

What about Windows or Linux (*nux) servers?
As configurations depends on server flavors, it is a different procedure on a Windows Box as compared to a Linux Box rather it is different on a IIS server as compared to Apache server or any other choice. According to the tests I can confirm that it is much easier on a Apache
server as compared to an IIS server.

Few links to help you configure your server for URL rewrite
On IIS try http://www.isapirewrite.com/ (commercial/paid)
On Apache try the mod-rewrite (Open source/FREE)
On Websphere try http://www.exforsys.com/tutorials/websphere/websphere-v5.0-running-applications-understand-session-manager.html

In the end of the day, it you and your application; For the love of coding... keep the cyber world clean and green!!!

=================================================
||My FREE services||
Parking WHOIS
and many more...
=================================================

No comments: