Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

iis7 rewrite with exception for virtual directory

Posted on 2010-09-14
4
Medium Priority
?
1,288 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 2000 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 feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

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…
Lync server 2013 or Skype for business Backup Service Error ID 4049 – After File Share Migration
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

722 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