URL Rewriting with IIS

It seems that the topic of the day, or rather the past 2 days, has been URL rewriting with IIS. Yesterday I read of Scott Hanselman’s realization concerning the different ways it was possible to get to his blog.

Nothing new really, but very valid. Page ranking can be affected by allowing these to methods. Many engines may recognize these as duplicate content rather than the same actual page. It makes one wonder if the terms URL and URI should really stand for Unique. Perhaps we could start calling them AURL’s and AURI’s, for Almost. I suppose it all depends on your point of view.

Scott’s discovery is simple to fix in Apache, as he describes, and as he points out it can also be accomplished with ISAP_Rewrite. Jeff Atwood talks more about this in his discussion about URL rewriting. He further hits upon a technique that we have used to avoid image hotlinking. Image hotlinking is the practice of someone putting an image in their web page that simply links to an hosted someone other person’s site. The effects of this can include increased bandwidth usage, inaccurate statistics and is considered, perhaps not unethical but certainly not accepted.

We decided to use ISAPI_Rewrite. We did try free option mentioned by Jeff, Ionic’s ISAPI Rewrite Filter, but the quirks weren’t worth the price of purchasing the product from Helicon. A colleague of mine at work has a good handle on the syntax. So far we have been very happy with the results and the performance. In our case the original need came from the requirement to integrate a commercial web package that performed some functions with one that we developed for other functionality. We had the need to provide a single login point rather than two authentication pages and it had to come before ASP was handed the request.

RewriteCond Host: (app\.mydomain\.com)
RewriteRule (?i:/login.aspx\??(.*)) http://www.mydomain.com/Login.aspx?FromApp=true&$2 [R]

We used similar methods to redirect to pages for the users profile, password changing and other things. It seems to work pretty good so far, and with it came the ability to fix the problems mentioned by Jeff and Scott.

If you have any concern at all about the variables that can affect your page rank with the search engines you should analyze your pages and the possible ways they can be accessed and determine whether or not you need to use URL rewriting.

One last point. If you are not concerned about your page ranking, you should be. Otherwise, why put your content on the Internet?


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s