Please help me understand rewrite maps, I have this setup:
<rewriteMap name="MyMap"> <add key="/pages" value="/website/pages/index.aspx" /> <add key="/pages/page-1" value="/website/pages/page-1/index.aspx" /> <add key="/pages/page-1/section-1" value="/website/pages/page-1/section-1.aspx" /> </rewriteMap> Here is my rule:
<rule name="Rewrite rule for MyMap" stopProcessing="true"> <match url=".*" /> <conditions logicalGrouping="MatchAll" trackAllCaptures="false"> <add input="{MyMap:{REQUEST_URI}}" pattern="(.+)" /> </conditions> <action type="Rewrite" url="{C:1}" appendQueryString="true" /> </rule> This is working if I try to access these pages:
- www.mydomain.com/pages (OK)
- www.mydomain.com/pages/page-1 (OK)
- www.mydomain.com/pages/page-1/section-1 (OK)
But I want the possibility to add a query string on any of these pages, example:
- www.mydomain.com/pages?page=1 (FAIL)
When I try to access this page, I get a 404. How can I get this to work?