IIS7 URL Rewrite for URL with ’

Posted by blizz on Server Fault See other posts from Server Fault or by blizz
Published on 2012-09-13T15:36:45Z Indexed on 2012/09/13 15:39 UTC
Read the original article Hit count: 557

Filed under:
|

I'm trying to redirect the following URL in IIS7 using the URL Rewrite module:

Category/Cat-3/Objectives-of-Pre-Maintenance/WHAT’S-THE-STORY-ON-LOW-CARB-DIETS-AND-EXERCISE-.aspx

but for the life of me I can not get it. I tried replacing the ’ with an actual single quote, and that worked fine! But for the purpose of this redirect, I need the HTML code for the quote, and not the quote itself. Here is the rule from web config:

<rule name="Redirect" patternSyntax="ECMAScript" stopProcessing="true">
                <match url="^Category/Cat-3/Objectives-of-Pre-Maintenance/WHAT&amp;rsquo;S-THE-STORY-ON-LOW-CARB-DIETS-AND-EXERCISE-\.aspx" />
                <conditions>
                    <add input="{HTTP_HOST}" pattern="www.example.com" />
                </conditions>
                <action type="Redirect" url="http://www.example.com/redirecturl/" appendQueryString="false" />
            </rule>

Any ideas would be very helpful! Thanks

© Server Fault or respective owner

Related posts about iis7

Related posts about rewrite