Solved

iis7 rewrite with exception for virtual directory

Posted on 2010-09-14
4
1,281 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
[X]
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
  • 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

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

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

Running classic asp applications under Windows Server 2008 R2 (x64) and IIS 7 is not as easy as one may think. It took me a while to figure it out while getting error 8002801d a few times. After you install the OS you will need to install the fol…
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

624 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