Although preliminary findings by Scott Mitchell indicate blog posts on Fridays aren't paid much attention, I'm going forward with a Friday afternoon blog entry. What the heck, the office is practically empty and I'm all caught up for once.
Something that has been coming up more and more is SEO, or Search Engine Optimization. It's a big deal for our ecommerce customers who want to be high in the Google and Yahoo search results. While I don't get involved in the SEO details very often, there are ways that software development (which is my main job) overlaps with SEO. One of these main overlaps is with URL Rewriting -- where you map a search engine unfriendly name like “http://www.Domain.Com/products/prodDetailView.aspx?pid=3432&catid=3434355” to something more meaningful to the search engine spiders like “http://www.Domain.Com/TabletPC-Computers.aspx”.
I don't know the ins-and-outs of google's algorithm (although in a few conversations with these guys they claim to), but the full substance of an HTML page can be considered by the search engines. This means the first url with the nasty querystring is meaningless and can't contribute to a page's search ranking, while the 2nd url is more substantial and may add to the page's rank for TabletPCs and Computers.
Before .Net this was a tricky ISAPI issue for Windows servers; now, via the HttpContext.Current.RewritePath() method, we can Rewrite URLs relatively easily.
This CSharpFriends article has a quick snippet that illustrates the basics; 15Seconds has a much more in depth treatment. We've got our own “engine“ and the boss man would frown on me posting it (although it's not rocket science!). You intercept the request for the friendly URL in the Application_BeginRequest event handler and rewrite it as the one your system recognizes:
HttpContext myContext = HttpContext.Current;
myContext.RewritePath("HttpContext_Next.aspx");
To understand the SEO side a bit more, check out Page 1 or Page 2 of this article from the SEOConsultants.
In the future I may discuss some of the other ways software development supports a site's SEO efforts; after all, who cares if the site is well programmed if nobody can ever get to it?
Happy .Netting!