Solved

iis7 rewrite with exception for virtual directory

Posted on 2010-09-14
4
1,248 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

First of all, clustering IIS is something you should rarely consider doing. In almost all cases, Microsoft Network Load Balancing (NLB) (http://technet.microsoft.com/en-us/library/cc758834(WS.10).aspx) is a much better solution when you need to p…
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.
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …
Send secure, cloud-based, encrypted alerts and maintain HIPAA compliant messaging. Integrates priority & secure messaging into one application. Ensures IT, emergency respondents and healthcare professionals that their critical messages are never mis…

911 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

20 Experts available now in Live!

Get 1:1 Help Now