Tom Lauck’s

IIS 7, SEO, and You: Part 1 – URL Rewriting


If you currently do not take a technical interest in Search Engine Optimization (SEO) as a developer, you should.  As opposed to Search Engine Marketing (SEM), an effective SEO plan can often only be implemented by a developer becuase of it’s technical nature.  One such optimization is url rewriting.  A few minutes spent searching on Goolgle will uncover what has been going for years in the Apache world with mod_rewrite and .haccess.  The great thing about mod_rewrite is that you have full control over url structure, and essentially the way search bots crawl through your site.  Many have termed .htaccess/mod_rewrite as “the Swiss Army Knife of SEO.”

Some basic rules that most optimiztion plans include is redirecting to a canonical domain, adding a trailing slash, and removing file extensions. Since II7 natively supports url rewriting now, achieving is very straightforward. There are number of methods to do this, but one way is adding some rules to your Web.config file.

Sample rules for cannonical domain redirect, trailing slash, and file extension:

		<rule name="Redirect To Cannonical Domain" stopProcessing="true">
			<match url="^(.*)$" />
				<add input="{HTTP_HOST}" pattern="!^example\.com" />
			<action type="Redirect" url="$1" redirectType="Permanent" />
		<rule name="Remove Index Pages" enabled="true" stopProcessing="true">
			<match url="(.*)(index|default)\.(asp|aspx|html|htm)$" />
			<action type="Redirect" url="{R:1}" appendQueryString="true" />
		<rule name="Add Trailing Slashes" enabled="true" stopProcessing="true">
			<match url="^([^.?]+[^.?/])$" />
			<action type="Redirect" url="/{R:1}/" redirectType="Permanent" />
		<rule name="Remove File Ext Reverse" enabled="true" stopProcessing="true">
			<match url="^(.+)\.aspx$" />
				<add input="{REQUEST_METHOD}" negate="true" pattern="^POST$" />
			<action type="Redirect" url="/{R:1}/" appendQueryString="true" redirectType="Permanent" />
		<rule name="Remove File Ext" stopProcessing="true">
			<match url="^(.+)/$" />
				<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
				<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
			<action type="Rewrite" url="/{R:1}.aspx" appendQueryString="true" />

Avoiding duplicate content (http://www vs http:// or /pathtofile/ or /pathtofile), reducing Search Engine Ranking Page (SERP) ranking drops with a relaunch or update, and over solid URL structure are just some of the benefits of a good URL rewriting scheme.  Now that IIS 7 has a URL Rewrite as built in component, web applications built on .NET can be ever more powerful.  In the next part of the series, we will look at the new beta of the Search Engine Toolkit for IIS 7.

Jun 10 2009

Time is Money, Platform Matters


Moral of the story, choose your platform wisely.  When I drafted this post in the spring, the intent was to showcase the power of highly developed platforms like ASP.NET as opposed to Ruby.  I was then going to throw all the RoR people under the bus for jumping on a bandwagon :) [prepare for getting hit over the head by Ruby people]

But now that I am in an environment where I am constantly confronted with a heavy Java back-end, this comparison seems so much more powerful. [prepare for getting hit over the head by Java people]  Granted process has a lot to do with the excessive production time some companies face, however, language and platform choice clearly has a significant impact.  In large corporate environments, elevations to production can creep on several years of work.  Platform choice, along with process management goes a long way in cutting down on time it takes to elevate.

Below is a collection of 4 screencasts from that I found on Viddler depicting a “bake-off”.  Essentially developers were given the same task of building the same basic web application.  The results were recorded and put side by side.

ASP.NET, Ruby, Java, Perl Side by Side Comparison

In the end, if time is money the findings show that it would be logical to use ASP.NET.  In many cases, this could be attributed to Visual Studio as an excellent development tool.  The intellisense available in VS is very different and far better from almost ever other tool/editor I have used.

To add more in favor of Visual Studio being a winning tool, this screencast was completed before jQuery began shipping with Visual Studio.  jQuery has transformed the JavaScript world, and coupled with beefed up support for JavaScript intellisense in Visual Studio 2008, development time is cut down dramitically.  

One can argue over intricacies of the languages, however, the speed of C# and RAD capabilities in Visual Studio make the VS/.NET combo a robust and rapid web development platform.

And I Digress…

While slightly off topic, this also serves a nice message to Adobe.  Flex is a step in the right direction, but Visual Studio 2008 is a far better development tool than Flex Builder is in its wildest dreams.  If Silverlight begins to get better market penetration, Adobe will be forced to innovate, and perhaps Microsoft would even create a development tool for Mac.  The reality is, Flex will have the Mac market so long as Visual Studio is Windows only.  If Adobe is to keep their choke hold on the RIA market for years to come, they need to take some lessons from VS2008.

Oct 29 2008

The Futures is Here


Microsoft has released ASP.NET Futures. Although I loathe Microsoft as much as drinking warm milk on a hot day, I am quite pleased. Microsoft now gives us full access to WPF/WCF, great new AJAX functionality, and you know that web.sitemap file…well now you can provide it to Google or any other sitemap service without writing a single line of code.

There are some nice quick starts on the MS site. So what are you waiting for, go download Futures now!

Jul 14 2007