简体   繁体   中英

Custom Rewrite Provider for URL Rewrite Module

I have a Custom Rewrite Provider for URL Rewrite Module running in IIS, I use to redirect request based on my custom logic.

It is based on this: http://www.iis.net/learn/extensions/url-rewrite-module/developing-a-custom-rewrite-provider-for-url-rewrite-module

How can I access input header from my code?

So found the answer, it uses a naming convention:

Server variables can also be used to access HTTP headers from the current request. Any HTTP header supplied by the current request is represented as a server variable that has a name generated in accordance to this naming convention:

All dash ("-") symbols in the HTTP header name are converted to underscore symbols (" "). All letters in the HTTP header name are converted to capital case. "HTTP " prefix is added to the header name.

in my case, I ended up with something like this in my Action Properties \\ Redirect URL: {RoutingProvider: {QUERY_STRING}|{HTTP_ORGANISATIONID}}

HTTP_ORGANISATIONID is my custom header.

Thanks

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM