URL Rewrite outbound rule examples

Here I’m providing short examples with ui rules only. I’ll assume you have some knowledge in URL Rewrite otherwise I’ll suggest you to read official documentation at http://www.iis.net/learn/extensions/url-rewrite-module/using-the-url-rewrite-module

I’m listing below some examples in the form of questions and how to solve them

Outbound rules

Note: in some of the outbound rules precondition responseHtml1 configured as below

1) Add custom script at the end of the response html

2) Add custom script at the beginning of response html

3) Rewrite subdomain with different domain with same URL path and query

Example:  I want to rewrite




Only domain part is changing, path and query is same.

4) Modify redirect location domain to a different domain with same path and query only when particular words exists.

For example:

Modify response header location if path starting with accounts or customer to different domain

http://www.rajbandi.net/account/login.aspx  or http://www.rajbandi.net/customer/login.aspx


http://www.rajbandi.com/account/login.aspx or http://www.rajbandi.com/customer/login.aspx

5) Remove body onload function in response html





6) Find all the links with some text and prevent click on them


Click here to visit rajbandi.net;


Click here to visit rajbandi.net

Alternatively, you can attach some javascript(preventDefault or something) to href

I’ll update more examples asap.

1 thought on “URL Rewrite outbound rule examples

Leave a Reply

Your email address will not be published. Required fields are marked *