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?

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

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


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x