Custom Rewrite Provider for URL Rewrite Module

六眼飞鱼酱① 提交于 2019-12-31 04:29:29

问题


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?


回答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



来源:https://stackoverflow.com/questions/23900415/custom-rewrite-provider-for-url-rewrite-module

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!