Interested in a FREE URL Rewriter for IIS? Do you wish IIS had a mod_rewrite? Check out IIRF.
IIRF is a small, cheap, easy to use, URL rewriting ISAPI filter
that combines a good price (free!) with good features. It is
reasonably fast, and reasonably powerful. You can get the
source code to inspect it or modify it yourself if you desire.
If you use IIS, you can download IIRF
and get started right now. Or, Visit the IIRF Forums to ask a question.
Why Rewrite URLs?
Server-side rewriting of URLs means a URL
like http://foo/bar/bam can be translated, on the server, into
http://foo/baz/bam.jsp or http://foo/something/dispatch.cgi?q=bam or
http://bam/hello/foo.aspx or... anything! The browser is none the wiser.
Rewriting URLs on the server-side goes way back. It has a bunch of advantages:
you can use pretty URLs ("Search-engine
friendly", "Search Engine Safe" (SES), or "Search-Engine
Optimized" (SEO) URLs), with web application platform
infrastructure that uses or generates ugly URLs. Some web or
portal servers are notorious for generating ugly URLs, but you
don't need to expose them to the world.
URLs can stay pretty, even if you change the server-side
system (eg, dispatch.fcgi instead of .cgi, or .aspx instead of
.jsp).
you can migrate or modify sites, without stranding old links.
It's really convenient with Cold Fusion, PHP, Ruby, Joomla,
ASP.NET, JSP or any number of other server-side technologies
these days.
Why was IIRF created?
Apache has mod_rewrite, which allows URL rewriting. But IIS
doesn't have anything similar as a built-in, or as a "standard" free
add-on.
ASP.NET has a URL mapping mechanism, but it works only for
filetypes that are handled by ASP.NET: aspx, ascx, asmx, and so
on. For static files or non-ASP.NET files, (xml, gif, jpg, css),
the ASP.NET mapping won't work cleanly.
IIS, like the Apache HTTP server, has an extension mechanism:
it is called the ISAPI filter. There are commercial ISAPI
filters that endow IIS with the ability to re-write URLs. But
you have to pay. There are free ones, but they generally don't
offer regular expression matching, or automatic ini file
reloading, or other powerful features. IIRF is a small, cheap,
easy to use, URL rewriting ISAPI filter that combines a good
price (free!) with good features.
Easy to afford: there is no fee or cost to use IIRF.
Simple to install: just 2 minutes.
Simple to configure: put your rewrite rules in a text file, using a simple syntax, similar to Apache
Simple to get started: documentation and example RewriteRules are included.
Easy to live with: automatic ini file reloading, without IIS restart. [U] unmangle option allows logging of original Search-engine friendly URLs in IIS log files.
Capable: RewriteCond is supported, and Redirects are supported (as of v1.2.4). You can chain RewriteCond's, and you can rewrite based on the state of the underlying filesystem.
License
---------------------------------
Ionic's ISAPI Rewrite Filter is an add-on to IIS that can
rewrite URLs. IIRF and its documentation is distributed under
the Microsoft Permissive License, which is spelled out below.
IIRF depends upon PCRE, which is licensed independently and
separately.
Microsoft Permissive License (Ms-PL)
Published: October 12, 2006
This license governs use of the accompanying software. If you
use the software, you accept this license. If you do not accept
the license, do not use the software.
1. Definitions
The terms "reproduce," "reproduction," "derivative works," and
"distribution" have the same meaning here as under
U.S. copyright law.
A "contribution" is the original software, or any additions or
changes to the software.
A "contributor" is any person that distributes its contribution
under this license.
"Licensed patents" are a contributor's patent claims that read
directly on its contribution.
2. Grant of Rights
(A) Copyright Grant- Subject to the terms of this license,
including the license conditions and limitations in section 3,
each contributor grants you a non-exclusive, worldwide,
royalty-free copyright license to reproduce its contribution,
prepare derivative works of its contribution, and distribute its
contribution or any derivative works that you create.
(B) Patent Grant- Subject to the terms of this license,
including the license conditions and limitations in section 3,
each contributor grants you a non-exclusive, worldwide,
royalty-free license under its licensed patents to make, have
made, use, sell, offer for sale, import, and/or otherwise
dispose of its contribution in the software or derivative works
of the contribution in the software.
3. Conditions and Limitations
(A) No Trademark License- This license does not grant you rights
to use any contributors' name, logo, or trademarks.
(B) If you bring a patent claim against any contributor over
patents that you claim are infringed by the software, your
patent license from such contributor to the software ends
automatically.
(C) If you distribute any portion of the software, you must
retain all copyright, patent, trademark, and attribution notices
that are present in the software.
(D) If you distribute any portion of the software in source code
form, you may do so only under this license by including a
complete copy of this license with your distribution. If you
distribute any portion of the software in compiled or object
code form, you may only do so under a license that complies with
this license.
(E) The software is licensed "as-is." You bear the risk of using
it. The contributors give no express warranties, guarantees or
conditions. You may have additional consumer rights under your
local laws which this license cannot change. To the extent
permitted under your local laws, the contributors exclude the
implied warranties of merchantability, fitness for a particular
purpose and non-infringement.
All of the features are described in a single readme file,
which is included in the download. There are also lots of examples to help
you get started.
NB: As of v1.2.4, IIRF can do redirects. You can
set up a rule that says that http://yourserver/something/baz
should be redirected to http://Otherserver/something/baz.
These
are browser-side redirects (HTTP 302). The address in the
browser will be updated, and the browser will then automatically contact the new
site to fetch data.
IIRF does not do server-side request proxying and reverse-proxying, like Apache mod_proxy.
NB: As of v1.2.5, IIRF is built with VC8, the
compiler that comes with Visual Studio 2005, or Visual C++ 2005
Express. This is probably important only to those people who
want to build the source.
Release history
v1.0 2005 January
v1.0.1 2005 July
v1.1 2005 September
v1.2 2006 February
v1.2.2 2006 April (bugfix+testing)
v1.2.3 2006 May (more bugfixes+testing)
v1.2.4 2006 May (added redirection)
v1.2.6 2006 June (converted to safe CRT routines)
v1.2.9 2006 July (Modifier flags like U, R, L, I, F, NF)
v1.2.10 2006 Sept (special patterns: -d, -f, -s; chaining RewriteCond)
v1.2.11 2007 Feb (new filter priority, new flow logic)