IIS 7.5 URL Rewrite rules

I've got a website, http://www.mydomain.com, running on IIS 7.5 on Windows Server 2008 R2.

I'm trying to use the native IIS URL Rewrite utility to accomplish the following:

1. Redirect all requests for mydomain.com/SamplePage.aspx to mydomain.com/NewDirectory/SamplePage.aspx
2. ...EXCEPT for mydomain.com/blog, which should stay as-is.
3. Hide the redirect from the user, so that they don't see the /NewDirectory/ portion of the path.

I've gotten part of the way there with a Redirect rule to redirect "*" (all requests) to "/NewDirectory", where the request does not match the pattern "*/NewDirectory" or "*/blog".

This rule works to divert traffic to the NewDirectory folder, but causes all URLs on the site to display to the user as "http://www.mydomain.com/NewDirectory", which is pretty much the opposite of what I want. If I understand correctly, I need a corresponding Rewrite rule to correct the URL display; can someone please advise me on how I would configure this?
Your help is appreciated, thanks!
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Randy DownsOWNERCommented:
Maybe this will help.

My requirement:

Mask the redirection of www.bob.com to www.abc.com/bob/index.html - the end user should not see the www.abc.com

For IIS7 you will indeed need AAR. There are 3rd party modules available that can do what you need as well such as Helicon Ape: https://www.helicontech.com/ape/

Using AAR: http://blogs.msdn.com/b/carlosag/archive/2010/04/02/setting-up-a-reverse-proxy-using-iis-url-rewrite-and-arr.aspx

You'll be reverse proxying requests for http://www.bob.com/ to http://www.abc.com/bob/

In Apache, with the correct modules loaded, it can be done as:

RewriteCond %{HTTP_HOST} ^www\.bob\.com [NC]
RewriteRule (.*) http://www.abc.com/bob$1 [P,L]

Open in new window

Steve BinkCommented:
I do not believe you will need a third party module for this.  IIS URL Rewrite is supposed to have this capability.

Take a look through the docs and examples found at the link above, then focus on setting up the reverse proxy.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Seth SimmonsSr. Systems AdministratorCommented:
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft IIS Web Server

From novice to tech pro — start learning today.