自定义重写提供程序的URL重写模块 [英] Custom Rewrite Provider for URL Rewrite Module

查看:171
本文介绍了自定义重写提供程序的URL重写模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对URL重写模块运行在IIS中自定义重写提供,我使用基于我的自定义逻辑来重定向请求。

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

它是基于这样的:<一href=\"http://www.iis.net/learn/extensions/url-rewrite-module/developing-a-custom-rewrite-provider-for-url-rewrite-module\" rel=\"nofollow\">http://www.iis.net/learn/extensions/url-rewrite-module/developing-a-custom-rewrite-provider-for-url-rewrite-module

我怎样才能从我的code访问输入头?

How can I access input header from my code?

推荐答案

于是找到了答案,它使用的命名约定:

So found the answer, it uses a naming convention:

服务器变量也可以被用来从当前请求访问的HTTP标头。由当前请求提供的任何HTTP头是psented因为,按照这个命名约定生成了一个名称的服务器变量重新$ P $:

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:

所有破折号( - )在HTTP标头名称符号转换为下划线符号()。
 在HTTP标头名称的所有字母都转换为死刑的案件。
 HTTP
的preFIX被加到头名。

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.

在我的情况,我结束了我的操作属性\\重定向URL是这样的:
{RoutingProvider:{QUERY_STRING} | {HTTP_ORGANISATIONID}}

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

HTTP_ORGANISATIONID是我的自定义标题。

HTTP_ORGANISATIONID is my custom header.

感谢

这篇关于自定义重写提供程序的URL重写模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆