Solved

IIS 7 - Using Url Rewrites and then redirecting "everything else"

Posted on 2011-09-29
2
402 Views
Last Modified: 2012-05-12
I want to redirect certain pages from one site to certain other pages on our other site. Then I want to redirect everything that is left to one page on the other site.

I can use the http redirect to send the whole site over OR I can use URL Rewite to send certain pages to the other site's pages but I can't figure out how to do the "everything else" part.

Here's what I have so far. This wil redirect individual pages. When I added an http redirect, that takes precedence and the whole thing goes to newsite.com
              <rewrite>
            <rewriteMaps>
              <rewriteMap name="NewSite 301 Redirects">
                <add key="/contact.aspx" value="http://www.newsite.com/ContactUs.aspx" />
              </rewriteMap>
            </rewriteMaps>
            <rules>
                <rule name="Rewrite rule1 for NewSite 301 Redirects">
                    <match url=".*" />
                    <conditions>
                        <add input="{NewSite 301 Redirects:{REQUEST_URI}}" pattern="(.+)" />
                    </conditions>
                    <action type="Redirect" url="{C:1}" appendQueryString="false" />
                </rule>
            </rules>
        </rewrite>
0
Comment
Question by:EndeavorToPersevere
[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
2 Comments
 
LVL 11

Accepted Solution

by:
G_H earned 500 total points
ID: 36817420
I always add Rewrite via the GUI. I can see from the GUI side that there is the option to run a rule where the "pattern does not match"

My thinking here would go something like

Contact Rule (contact.aspx)
Next rule (next.aspx)
...

All other rule (NOT match contact.aspx) Do something else...

Would this work?

GH
0
 
LVL 2

Author Closing Comment

by:EndeavorToPersevere
ID: 36817481
Perfect! Thank you!!!
0

Featured Post

Turn Insights Into Action

You’ve already invested in ITSM tools, chat applications, automation utilities, and more. Fortify these solutions with intelligent communications so you can drive business processes forward.

With xMatters, you'll never miss a beat.

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…
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

696 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