Error using rewritemaps attributeRSS

2 replies

Last post Apr 30, 2020 09:52 AM by samwu

  • Error using rewritemaps attribute

    Apr 29, 2020 03:48 PM|alvargamdc|LINK

    I Created a web.config file to redirect old site pages to new site pages within the site but there are two issues:

    1. 1. The current http to https rule stops working after adding the rewritemaps option
    2. 2. From the list of links on the rewritemaps list only the first two redirects work, the other two does not work.

    I use the IIS 10 rewrite package  to create the web.config file.

    <?xml version="1.0" encoding="UTF-8"?>
                    <rule name="SecureIndexPage" patternSyntax="ECMAScript" stopProcessing="true">
                        <match url="^$" />
                        <action type="Redirect" url="" appendQueryString="false" redirectType="Found" />
                    <rule name="All requests secure redirect" stopProcessing="true">
                        <match url="^.+$" />
                            <add input="{HTTPS}" pattern="OFF" />
                        <action type="Redirect" url="{R:0}" logRewrittenUrl="true" redirectType="Permanent" />
                    <rule name="Redirect rule1 for oldsite">
                        <match url=".*" />
                            <add input="{oldsite:{REQUEST_URI}}" pattern="(.+)" />
                        <action type="Redirect" url="{C:1}" appendQueryString="false" />
                    <rewriteMap name="oldsite">
                        <add key="/volunteer.asp" value="/public-defender/volunteer.asp" />
                        <add key="/contact.asp" value="/public-defender/contact.asp" />
                        <add key="/employees.asp" value="/public-defender/employees.asp" />
                        <add key="/donate.asp" value="/public-defender/donate.asp" />
                        <add key="/work.asp" value="/public-defender/work.asp" />
                        <add key="/location.asp" value="/public-defender/location.asp" />
                        <add key="/maps.asp" value="/public-defender/maps.asp" />
                        <add key="/clients.asp" value="/public-defender/clients.asp" />

  • Re: Error using rewritemaps attribute

    Apr 29, 2020 08:10 PM|lextm|LINK

    Lex Li
    Affordable IIS Consulting Services at
    This posting is provided "AS IS" with no warranties, and confers no rights.
  • Re: Error using rewritemaps attribute

    Apr 30, 2020 09:52 AM|samwu|LINK

    Hi alvargamdc, 

    The rules work like a charm so could you help clear whether binding and are under the same site?

    If so, please try to clean browser cache.  

    If they are under different sites, please swap the order of rule #2 and #3. 

    Best regards,