?
Solved

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

Posted on 2011-09-29
2
Medium Priority
?
403 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 2000 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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.
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

762 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