Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

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
*.truesecrets.com.au to be forwarded to *.truesecrets.com.au/strange-tours-melbourne/

so for example
m.truesecrets.com.au is forwarded to m.truesecrets.com.au/strange-tours-melbourne/
m.truesecrets.com.au/test is forwarded to m.truesecrets.com.au/strange-tours-melbourne/test
www.truesecrets.com.au is forwarded to www.truesecrets.com.au/strange-tours-melbourne/
www.truesecrets.com.au/test is forwarded to www.truesecrets.com.au/strange-tours-melbourne/test


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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I was supporting a handful of Windows 2008 (non-R2) 2 node clusters with shared quorum disks. Some had SQL 2008 installed and some were just a vendor application that we supported. For the purposes of this article it doesn’t really matter which so w…
A phishing scam that claims a recipient’s credit card details have been “suspended” is the latest trend in spoof emails.
This tutorial will walk an individual through configuring a drive on a Windows Server 2008 to perform shadow copies in order to quickly recover deleted files and folders. Click on Start and then select Computer to view the available drives on the se…
This tutorial will walk an individual through setting the global and backup job media overwrite and protection periods in Backup Exec 2012. Log onto the Backup Exec Central Administration Server. Examine the services. If all or most of them are stop…

808 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