« Previous Next »

Thread: IIS Rewrite and Mapping

Last post 07-07-2009 11:44 PM by ruslany. 2 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (3 items)

Sort Posts:

  • 07-03-2009, 5:52 AM

    • Cropsy
    • Not Ranked
    • Joined on 07-03-2009, 9:49 AM
    • Posts 2

    IIS Rewrite and Mapping

    I'm a bit stumped by this.

    Using IIS 7, I want to rewrite the following url (as an example):

    http://www.samuel-windsor.co.uk/coats/samuel-windsor/mens-clothing

    to

    http://www.samuel-windsor.co.uk/ProductsInCounter.cfm?subcat=5462&ShopRef=73&cat=574

    I would create entries in a Rewrite Map so that I could map the value 5462 to coats, 73 to samuel-windsor and 574 to mens-clothing.

    But, for the life of me, I can't get it to work. Does anyone have any advice?

  • 07-06-2009, 8:00 AM In reply to

    • Cropsy
    • Not Ranked
    • Joined on 07-03-2009, 9:49 AM
    • Posts 2

    Re: IIS Rewrite and Mapping

     I'm coming at this from a different direction, just to see if I can get this to work.

     I've created a seperate rewrite map called samwin.config which looks like this:

         <rewrite>
                <rewriteMaps>
                    <rewriteMap name="samwin">
                        <add key="mens-clothing/coats" value="ProductsInCounter.cfm?subcat=5462&amp;ShopRef=73&amp;cat=574" />
                        <add key="mens-clothing/coats/raincoat-black" value="ProductDetailInfoWithOptions.cfm?ID=SW-BVG06&amp;ShopRef=73&amp;Prime=Yes&amp;shopListRec=41251" />
                    </rewriteMap>
                </rewriteMaps>
            </rewrite>

    I call this from web.config as follows:

     <rewrite>
        <rewriteMaps configSource="samwin.config" />
                   <rules>
                    <rule name="MainRewrite" stopProcessing="true">
                        <match url=".*" />
                        <action type="Rewrite" url="{arseface.config:{R:1}}" />
                    </rule>
                </rules>
     </rewrite>

    However, I get a 500.50 URL Rewrite Error. The error code is 0x8007000d, and the Config Error states "Specified configSource cannot be parsed", referring to this line: <rewriteMaps configSource="samwin.config" />

     

     

     

  • 07-07-2009, 11:44 PM In reply to

    • ruslany
    • Top 25 Contributor
    • Joined on 07-01-2007, 3:38 PM
    • Redmond, WA
    • Posts 661

    Re: IIS Rewrite and Mapping

    Couple of things to try:

    1. In samwin.config file remove the <rewrite> and </rewrite> tags.
    2. If #1 does not help - check if rewrite map works when it is not in external file but in the web.config inside of the <rewrite> section

    Also, the reference to the rewrite map in the rule action does not look correct.

    http://ruslany.net
Page 1 of 1 (3 items)
Microsoft Communities