2

Is it possible to access a dictionary or something of a certain rewrite map from your rewrite custom provider?

Something like...{Provider:key,mapname}

which in code does something like {Mapname:key}

?

Vladan Strigo
  • 551
  • 1
  • 7
  • 19

1 Answers1

2

When you inherit from IRewriteProvider, in your Initialize() method you will get a Dictionary with all the settings:

public void Initialize(IDictionary<string, string> settings, IRewriteContext rewriteContext)
{
    ...
}

which comes from the following config section:


<system.webServer>
  <rewrite>
    <providers>
      <provider name="MyCustomRewriteProvider" type="MyCustomRewriteProvider.....">
        <settings>
          <!--add key="keyName" value="keyValue" /-->
        </settings>
      </provider>
    </providers>
  </rewrite>
  ...
</system.webServer>

You can refer to this article for detailed information on how to create a custom URL Rewrite provider:

kateroh
  • 4,382
  • 6
  • 43
  • 62
  • 1
    but this was not the question?! the question was about rewrite maps in provider, not setting in provider? – Vladan Strigo Feb 03 '11 at 07:28
  • Kateroh - Can you please help here - http://stackoverflow.com/questions/34506551/reading-a-cookie-value-using-url-rewrite-for-iis-wizard-unable-to-validate-at – kudlatiger Dec 29 '15 at 07:43