Skip to Content
Professional Microsoft IIS 8
book

Professional Microsoft IIS 8

by Kenneth Schaefer, Jeff Cochran, Scott Forsyth, Dennis Glendenning, Benjamin Perkins
November 2012
Intermediate to advanced
984 pages
27h 56m
English
Wrox
Content preview from Professional Microsoft IIS 8

Applying URL Rewrite Rules

URL Rewrite rules can be applied at different levels. Understanding these levels will help you know where to create the rules.

Rules are processed starting with the server level on down to the site and subfolders. URL Rewrite itself is processed very early in the IIS pipeline, before most IIS-related functionality. However, it runs after the site binding, so all page requests must be bound to a website, even if you use URL Rewrite. If the rule redirects back to the same server, you will need a binding for both URLs.

For global rules (<globalRules />), URL Rewrite runs during the PreBeginRequest event in the IIS pipeline, whereas for other rules (<rules />), URL Rewrite runs in the BeginRequest event in the IIS pipeline. The following shows the flow of the request as it pertains to URL Rewrite:

Incoming request ⇒ Site binding ⇒ If the request arrives using SSL, the packet is decrypted ⇒ URL Rewrite runs ⇒ Site is processed

Next, let's take a look at the different levels where rules can be applied.

Global Level—<globalRules>

Global rules apply to all traffic, regardless of the site, although you can apply conditions to rules so that they are filtered to just certain traffic.

Global rules are set in %windir%\System32\inetsrv\config\applicationHost.config in the following section:

<configuration>
 <system.webServer>
  <rewrite>
   <globalRules>
    <rule /> </globalRules> <outboundRules> <rule /> </outboundRules> </rewrite> </system.webServer> </configuration>  ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Professional IIS 7 and ASP.NET Integrated Programming

Professional IIS 7 and ASP.NET Integrated Programming

Dr. Shahram Khosravi
How to Cheat at IIS 7 Server Administration

How to Cheat at IIS 7 Server Administration

Chris Adams, Brian Frederick, Pattrick Santry
Internet Information Services (IIS) 7.0 Resource Kit

Internet Information Services (IIS) 7.0 Resource Kit

Olga M. Londer Mike Volordarsky Brett Hill, Bernard Cheah, Steve Schofield, Carlos Aguiar Mares, Kurt Meyer, and Microsoft IIS Team

Publisher Resources

ISBN: 9781118417379Purchase book