Quantcast
Channel: URL Rewrite Module
Viewing all articles
Browse latest Browse all 2482

Multiple URL Redirects using maps not working

$
0
0

Hi people,

I'm trying to redirect multiple URLs to a new domain. The old pages exists both as www and non-www. I've been racking my brains why this doesn't work. I keep getting server error, 500. Forever grateful if someone could enlighten me, thx.

(there are  more url's in the actual mapping but just included two examples)

---

<rewrite>
<rewriteMaps>
<rewriteMap name="AllRedirects">

<add key="/AboutUs/Management.aspx" value="/company" />

<add key="/AboutUs/NewsRoom.aspx" value="/news" />

</rewriteMap>

          </rewriteMaps>

  <rules>

            <rule name="Redirect rule1 for Redirects">

                      <match url=".*" />

                      <conditions>

                          <add input="{AllRedirects:{REQUEST_URI}}" pattern="(.+)" />              

               </conditions>

                      <action type="Redirect" url="http://www.newdomain.com{C:1}" appendQueryString="false" />            

            </rule>                                                                

         <rule name="Redirect to www" patternSyntax="Wildcard" stopProcessing="true">

           <match url="*" />

           <conditions>

             <add input="{HTTP_HOST}" pattern="olddomain.com" />

           </conditions>

           <action type="Redirect" url="http://www.newdomain.com/{R:0}" />

         </rule>

      </rules>

    </rewrite>


Viewing all articles
Browse latest Browse all 2482

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>