Solved

iis7 rewrite with exception for virtual directory

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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

Here are the symptoms: You start receiving calls from users that one of your legacy web apps isn't coming up, so you log into your IIS 5 server to check it out.  When you pull up the services, you notice that the WWW Publishing service isn't runn…
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…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

821 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