【发布时间】:2014-08-04 22:56:26
【问题描述】:
我正在尝试使用 url 重写创建自定义服务器变量。 IIS 的 Url Rewrite 生成以下配置条目
<rewrite>
<rules>
<rule name="CName to URL - Rewrite" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{HTTP_HOST}" pattern="^(?!www)(.*)\.localfurnco\.de" />
</conditions>
<action type="Rewrite" url="?" appendQueryString="false" />
<serverVariables>
<set name="HTTP_MANUFACTURER" value="{C:1}" />
</serverVariables>
</rule>
</rules>
</rewrite>
但是在遍历服务器变量时,我找不到 HTTP_MANUFACTURER。 url 重写似乎有效,但我无法获取变量。
我正在尝试调用地址:test.localfurnco.de/subdir/webservice.asmx?wsdl。
C:1 在这种情况下应该是:“test”。
如果有任何建议,我将不胜感激 提前谢谢
【问题讨论】:
标签: c# iis url-rewriting web-config request.servervariables