Summary: URL Rewriting is a powerful was for webmasters to control what a URL really represents. IIS requires an extension in order to support url rewriting.
Does IIS Support URL Rewriting?
No. But then again yes. Let me explain ...
URL Rewriting is a technique available on many web servers that allows you the web master to make changes to URLs requested by clients before they are processed by your web server.
•
This one is best described by example. In a prior entry here I talked about using redir.pl to allow you to log and or redirect when people click an external link on your site. On the Ask Leo site the links that used redir.pl look like this:
http://ask-leo.com/cgi-bin/redir.pl?ms
That example link will take you to http://www.microsoft.com.
Even though redir.pl lets you make short URLs out of long ones, it still seems rather long and convoluted. And if you care about such things, many search engine crawlers will not index pages that contain "?" in their URLs.
Enter URL re-writing. Using URL re-writing, I can specify that any instance of "r-" in an incoming URL be replaced with "cgi-bin/redir.pl?". Then my redirected link looks like this:
http://ask-leo.com/r-ms
The URL redirector intercepts the incoming request, replaces "r-" with "cgi-bin/redir.pl?", and passes the result on to IIS for processing.
My example is quite literal - on this site I replace any instance of "r-", which means of course that I cannot use "r-" anywhere else in any of my URLs. That's something I'm willing to live with for simplicity. However most URL rewriters use regular expressions for pattern matching and replacing, so you can get quite specific and restrictive if specifying exactly what should get replaced and when.
IIS does not support URL rewriting itself. Rather, it supports an extension interface called ISAPI which allows add-ons to be installed into IIS. Add-ons like URL rewriters, for example.
Here are a few of the available rewriters at this writing:
Article C1836 - August 26, 2003
Ionic's ISAPI Rewrite Filter -
Posted by: Ionic Shade at June 7, 2006 3:01 PMhttp://cheeso.members.winisp.net/IIRF.aspx
free. Regular Expressions. Redirects, Rewrites. RewriteCond. checkitout.
There are also a few rewriting options from within ASP.NET, although they're not great. I've written up an overview of what you can do here:
http://philisoft.com/blog/url-rewriting-in-iis/
I ended up using Ionic's rewrite filter, works great.
Posted by: Phil Crosby at September 21, 2006 2:25 PMIs this the only way to redirect .htm or .html files on an IIS Server?
Greg Stanley
Posted by: gstanley at November 28, 2006 4:35 PMwww.flashtoybox.com
You can always use meta refresh tags.
Posted by: Leo Notenboom at November 28, 2006 4:39 PMYou can also use a custom 404 error page to catch missing urls(Or rewrite urls in this case), and then server.transfer to the correct page, or redirect.
Posted by: Tony Cheetham at December 5, 2006 3:12 AMMicronovae has recently released IIS Mod-Rewrite v2.0
http://www.micronovae.com/ModRewrite/ModRewrite.html
This URL rewriting module for IIS is compatible with Apache mod_rewrite, and it's Pro version is the only solution in the market that supports .htaccess configurations.
Posted by: micronovae at June 21, 2007 6:09 PMFor rewrite url, there is Guideman.
Posted by: yrm at September 27, 2007 5:46 PMhttp://na-s.jp/Guideman/index.en.html
Microsoft IIS team has released a technical preview of the URL rewrite module for IIS 7.0. This module, when final version ships, will be officially supported by Microsoft. You can get more information about it and download technical preview from here: http://learn.iis.net/page.aspx/460/using-url-rewrite-module/
Posted by: Ruslan Yakushev at July 21, 2008 9:41 AMHi guys, I have a question: Currenclty I use a 404 pages to perform a basic URL rewriting, that works perfectly so I am asking why there is a such plugins on IIS? Is there a performance issue?
Cheers
02-Oct-2008
Using a 404 pages to perform a basic URL rewriting is Good. But not support 304 Not Modified to increase performance by validation caching.
Posted by: Seris at October 7, 2008 8:57 PM