Hi
Just want to revise this thread - I'm having problems setting up a rewrite map config file.
In my web.config file I have:
<rewrite>
<rewriteMaps configSource="rewrite.config" />
<rules>
<rule name="SolidWoodProduct">
<match url="^Realwoodflooring/solidwoodflooring/([0-9]+)/" />
<action type="Rewrite" url="/realwoodflooring/solidwoodflooring/product.aspx?productid={R:1}" />
</rule>
<rule name="EngineeredWoodProduct">
<match url="^Realwoodflooring/engineeredwoodflooring/([0-9]+)/" />
<action type="Rewrite" url="Realwoodflooring/engineeredwoodflooring/product.aspx?productid={R:1}" />
</rule>
<rule name="LaminateFlooring">
<match url="^laminate/([0-9]+)/" />
<action type="Rewrite" url="Laminate/product.aspx?productid={R:1}" />
</rule>
<rule name="CarpetFlooring">
<match url="^carpet/([0-9]+)/" />
<action type="Rewrite" url="carpet/product.aspx?productid={R:1}" />
</rule>
<rule name="VinylFlooring">
<match url="^vinyl/([0-9]+)/" />
<action type="Rewrite" url="vinyl/product.aspx?productid={R:1}" />
</rule>
<rule name="Accessories">
<match url="^accessories/([0-9]+)/" />
<action type="Rewrite" url="accessories/product.aspx?productid={R:1}" />
</rule>
<<rule name="Redirect Rule" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{StaticRedirects:{REQUEST_URI}}" pattern="(.+)" />
</conditions>
<action type="Redirect" url="http://www.ourwebsite.com{C:1}" appendQueryString="False" redirectType="Permanent" />
</rule>
</rules>
</rewrite>
And have a seperate rewrite.config file with the following:
<rewriteMaps>
<rewriteMap name="StaticRedirects">
<!-- Up to date as of 07/01/09 ask Danielle before amending -->
<add key="/acatalog/Online_Catalogue_Karndean_Flooring_41.html" value="/newsite.aspx"/>
<add key="/ar_upside.cfm" value="/newsite.aspx"/>
<add key="/Bacu.cfm" value="/newsite.aspx"/>
------etc etc etc-----------------------------
</rewritemap>
</rewriteMaps>
I want the Redirect Rule to process from the rewrite.config file
, and all other rules as per the web config.
I can open up the rewrite map in IIS7, so I know thats good, and can include the reference in the config to the rewrite.config map. If I leave the Redirect Rule in the web.config, I get a generaic 500 error, and the site only works when I comment out the Redirect Rule.
Can anyone give me a pointer as to what I', doing wrong?!
Thanks