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

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

问题描述

我有一个用于在 IIS 中运行的 URL 重写模块的自定义重写提供程序,我用来根据我的自定义逻辑重定向请求.

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

基于此: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:

服务器变量也可用于从当前请求访问 HTTP 标头.当前请求提供的任何 HTTP 标头都表示为服务器变量,该变量的名称根据此命名约定生成:

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"前缀被添加到标头名称中.

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.

就我而言,我在我的 Action Properties Redirect 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天全站免登陆