URL Rewrite module for IIS7

Posted: May 31, 2008  51 comments  

Average Rating

Tags
Administrators
ASP.NET
Developers
IIS News Item
PHP

Share this Post

One of the most hotly requested features for IIS is now available!  Yesterday we shipped the first technical preview of a new URLrewrite module for IIS7.  It is free for all IIS7 users and available for download x86 and x64Thomas and Carlos have blogged about many of the details already, so be sure and check their posts out.  Ruslan also posted a bunch of really great walkthroughs on IIS7, which you can check out here, including:

Creating rewrite rules for the URL Rewrite Module

This walkthrough will guide you through how to create and test a set of rewrite rules for the URL rewrite module.

---------------------------------------------------------------------------------------------------------------------------------------------

Enabling Pretty Permalinks in WordPress

This walkthrough will guide you through how to enable “Pretty Permalinks” for blog posts in the WordPress blog engine installed on IIS 7.0.

image

---------------------------------------------------------------------------------------------------------------------------------------------

Using Failed Request Tracing to Trace Rewrite Rules

IIS 7.0 Failed Request Tracing (FRT) is a powerful tool for troubleshooting request-processing failures.

---------------------------------------------------------------------------------------------------------------------------------------------

Using Global and Distributed Rewrite Rules

This walkthrough will explain the different types of rules supported by URL rewrite module and will guide you through how to configure global and distributed rewrite rules.

---------------------------------------------------------------------------------------------------------------------------------------------

Using Rewrite Maps in URL Rewrite Module

This walkthrough will introduce you to the concept of rewrite maps in URL rewrite module and will guide you how to create rewrite rules that use rewrite maps.

image

---------------------------------------------------------------------------------------------------------------------------------------------

Importing Apache mod_rewrite Rules

IIS 7.0 URL rewrite module provides rule importing functionality that greatly simplifies the process of converting Apache mod_rewrite rules to IIS URL rewrite rules.

---------------------------------------------------------------------------------------------------------------------------------------------

Ruslan also has a full configuration reference for URLrewrite in this article:  URL Rewrite Module Configuration Reference.  Last, if you run into any problems or have a question about URLrewriting, be sure to check out the URLrewrite forum on http://forums.iis.net/.

Also note, there is a great partner solution available from Helicon Tech called IsapiRewrite.  This ISAPI-based solutions works well on IIS5/6/7 and provides a more complete set of rewriter functionality.  If you're not happy with the URLrewrite module for IIS7 or you're looking for a URLrewrite feature that works on all versions of IIS, check out IsapiRewrite

Comments

excellent.

i have a question.

is it possible for asp.net developers to use this functionality in their app ?(i mean they define their config in web.config) and asp.net do the rest?

Jun 01 2008 by Mojtaba

Good lord, welcome to 1997.  Congratulations!

Jun 01 2008 by Joe

thanks Joe!  I thought '97 was a good year too ;)

Jun 01 2008 by bills

Hi Mojtaba - yes, all types of applications (ASP, ASP.NET, PHP, ColdFusion, PERL, Python, Ruby, etc.) can use this URLrewrite module from IIS.  Just install the URLrewrite module on any IIS7 server (Vista SP1 or Windows 2008 Server) and configure it for your site/application in web.config or using the IIS Manager tool.  See the tutorials listed in my blog for more help getting started.

Jun 01 2008 by bills

thanks for your answer and guides about asp.net url rewrting.i am currently use an open source dll for it (urlrewriter.net)

Jun 02 2008 by Mojtaba

Thank you for including the mod_rewrite rule converter, it was the first thing I went looking for. :)

Jun 02 2008 by Andrew Storrs

Well, that was about time. Of course there's the small issue of having to upgrade to Windows Server 2008 to get any of this, but that's typical Microsoft.

Jun 02 2008 by Mike

I am genuinely conflicted by this news. I want to feel good about it, I really do, but I can't see giving you guys credit for finally matching a feature that Apache has had for many years. Not only are you late to the game on this feature, you are doing it in a way that it totally different than the de facto standard (you don't have an "import my .htaccess file" capability? You don't think this would be HUGELY useful?) Moreover, YOU ONLY FREAKING SUPPORT IIS7 WITH THIS!!! A lot of people are still using IIS6 and won't be upgrading anytime soon (hell, some of us are still using IIS5 and aren't upgrading because it still works).

Bill: please consider making and shipping something akin to mod_write for IIS6. Even this "made different than the standard for no good reason" will do if that's the only option.

Jun 02 2008 by Mike C.

Hi Mike-

We only intend to ship this feature for IIS7, because it was designed to integrate seamlessly with the new IIS7 extensibility model.  Unfortunately we can't do this level of integration with IIS6 due to architectural reasons.  In addition, there is a great solution already out there for IIS5/6 users with http://www.isapirewrite.com/ .  Be sure and check out that product. 

Also, you may have missed it in my post, but there is definitely an 'import .htaccess mod_rewrite rules'.  See this link:  learn.iis.net/.../importing-apache-modrewrite-rules

thanks,

bill

Jun 02 2008 by bills

不错;)

Jun 03 2008 by yuety.xie

Hi, is this rewrite module something that can be used on hosted solutions? (Is it a dll that I can import into my bin folder of my project and use it?) Or will I have to get my hosted provider to install it on my IIS7 account? Thanks

Jun 06 2008 by Anonymous

Hi Anonymous - this module is a native-code global module and would need to be installed by your hoster.  Once installed, it can be configured in your local web.config of the site/application, however.  For a managed code rewrite module that can be deployed in the bin directory of your application, see http://urlrewriter.net

Jun 08 2008 by bills

I can't seem to get lazy matching working on the HTTP_COOKIE header field.  I'm trying to match on a cookie like this:

COOKIE_NAME=(.*?);

but the lazy matching always takes all the cookies until the end.  If I use this:

COOKIE_NAME=(.*?;)

I get the cookie value, but with a semicolon attached.

When I test the first case in Expresso, it works correctly.  Is this a bug in the rewrite module?

Jun 24 2008 by lonevvolf

Never mind...found the problem there.  I just need a way to edit the header fields now, and I'm all set!  :S

Jun 24 2008 by lonevvolf

Site www.gotdotnet.ru/.../552493.aspx crash Opera.

Thanks.

Jun 26 2008 by Anonymous