Solved

iis7 rewrite with exception for virtual directory

Posted on 2010-09-14
4
1,244 Views
Last Modified: 2012-05-10
Right now we are using the IIS7 URL rewrite tool to redirect folks from https://site.name.com/ to https://site.name.com/folder1/default.aspx.  This is working perfectly.  Except, now I need to write an exception to allow some folks to directly access a virtual directory https://site.name.com/virtualdirectory.  

Thus, i still need rule 1.  But I also need to let folks go explicity to https://site.name.com/virtualdirectory without being redirected to https://site.name.com/

Again, this is the IIS7 URL rewrite utility.

Thanks.
0
Comment
Question by:katfpi
  • 3
4 Comments
 
LVL 30

Accepted Solution

by:
Brad Howe earned 500 total points
ID: 33675833
Hi,
Create your rule like such. This will only look for a clean URL at the root. So if a user types http://your.domain.com, they get redirected to http://your.domain.com/folder1/default.aspx.
If they type http://your.domain.com/somefolder/default.aspx, they will see http://your.domain.com/somefolder/default.aspx because the regex is not satisfied.
MATCH URL
   Requested URL: Matches the pattern                              Using:  Regular Expressions
   Pattern : (.*)                                                                          Ignore Case :  "Checked"

CONDITIONS
   Logical Grouping: Match All                          
            {URL}  - Match the pattern - ^/$
ACTION
   Action Type:  Redirect
   Redirect URL:  http://your.domain.com/folder1/default.aspx
   Append query string:  "Checked"
  Redirect Type:  Permanent (301)
 
cheers, Hades666
 
0
 
LVL 30

Expert Comment

by:Brad Howe
ID: 33676482
Hi,
You could also keep your existing rule and place a conditional filter on it.
CONDITIONS
   Logical Grouping: Match All            
              {REQUEST_URI}  - Does Not Match the pattern - ^somefolder$
Cheers,
Hades666
0
 

Author Comment

by:katfpi
ID: 33684920
Hades666,

Thank you.  I think I will add the conditional filter on my existing rewrite.

What does the carrot stand for in this syntax?  That didn't seem to work. ^somefolder$.  $ standsfor sub-directories and that worked fine.

I will post back and let you know how it goes.

Thanks, K
0
 
LVL 30

Expert Comment

by:Brad Howe
ID: 33684944
^ is start of String.
$ is end of string.
Cheers, -Hades666
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Debug Tools to analyse IIS process: This article focus on taking memory dumps from IIS to determine which code is taking more time and to analyse which calls hangs/causes more CPU usage. To take dumps,download the following. Install1: To st…
Prologue It is often required to host multiple websites on a single instance of IIS, mostly in development environments instead of on production servers. I am sure it is not much a preferred solution on production servers but this is at least a pos…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

747 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

14 Experts available now in Live!

Get 1:1 Help Now