Solved

IIS 7 Redirect Several Pages

Posted on 2011-02-21
1
646 Views
Last Modified: 2012-08-13
Currently for IIS6, we have several redirection sites configured and need to move them to an IIS7 server.
For example: User types http://website1/ (NOT fqdn) into IE and is redirected to http://website2.domain.com/page.aspx

In IIS7, using the URL Rewrite module, is there a way to use the rewrite maps to configure a single rule with multiple mappings?

I have tried, but cannot get the rule working correctly.
0
Comment
Question by:CanalIns
1 Comment
 
LVL 2

Accepted Solution

by:
CanalIns earned 0 total points
ID: 34945504
This seems to be working, but I don't know if it's best practices.

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="Redirect Rule" stopProcessing="true">
                 <match url=".*" />
                    <conditions>
                          <add input="{StaticRedirects:{HTTP_HOST}}" pattern="(.+)" />
                      </conditions>
                   <action type="Redirect" url="{C:1}" appendQueryString="False" redirectType="Permanent" />
                </rule>
            </rules>
            <rewriteMaps>
                <rewriteMap name="StaticRedirects">
                    <add key="ipmonitor2" value="https://xxxx.xxxxx.com/" />
                    <add key="cirs2" value="http://xxxxx/Reports/Pages/Folder.aspx" />
                </rewriteMap>
            </rewriteMaps>
        </rewrite>
    </system.webServer>

</configuration>
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Prologue It is often required to host multiple websites on a single instance of IIS, mostly in development environments instead of on production servers. I am sure it is not much a preferred solution on production servers but this is at least a pos…
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.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

856 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