IIS 7 URLreWrite Rule

Posted on 2011-09-27
Last Modified: 2012-06-27
Hi Experts,

I am looking for a URLreWrite module rule to be written.

I want all requests to
* to be forwarded to *

so for example is forwarded to is forwarded to is forwarded to is forwarded to


Question by:Craig Lambie
  • 2
LVL 10

Expert Comment

ID: 36709414

Author Comment

by:Craig Lambie
ID: 36709556
This is a complicated rule, I want some guidance on writing this actual rule, not general rules, I can google that :) - please.
LVL 30

Accepted Solution

Brad Howe earned 250 total points
ID: 36710008
Give this a shot.

Capture ALL URIs, check that it is not already a virtual root of /strange-tours-melbourne and then redirect to /strange-tours-melbourne/<the path in the url> IF the url is in the format domain/<path>

<rule name="Redirect /(.*) to /strange-tours-melbourne/(.*) " enabled="true" stopProcessing="true">                    
<match url="(.*)" />                    
 <conditions logicalGrouping="MatchAny">  
  <add input="{REQUEST_URI}" pattern="^/strange-tours-melbourne/(.*)$" negate="true" />                      
<action type="Redirect" url="http://{HTTP_HOST}/strange-tours-melbourne/{R:1}" appendQueryString="false" />                


Author Closing Comment

by:Craig Lambie
ID: 36714456
Exactly what I wanted, thanks :)

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you migrate a Terminal Server licenses server inside the 2008 server family, you can takte advantage of the build-in migration tool. If you like to migrate an older 2003 Server (and the installed client CALs) to a 2008 R2 server for example, you …
New Windows 7 Installations take days for Windows-Updates to show up and install. This can easily be fixed. I have finally decided to write an article because this seems to get asked several times a day lately. This Article and the Links apply to…
This tutorial will walk an individual through the steps necessary to configure their installation of BackupExec 2012 to use network shared disk space. Verify that the path to the shared storage is valid and that data can be written to that location:…
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now