i am trying to create a custom servervariable with url rewrite. Url Rewrite for IIS generates the following config entry
<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>
But when iterating through the servervariables i can't find HTTP_MANUFACTURER. The url rewrite seems to work but i can't get the Variable.
I am trying to call the address: test.localfurnco.de/subdir/webservice.asmx?wsdl.
C:1 should in this case be: "test".
I would be grateful for any suggestion and thanks in advance
After trying some hours i figured it out myself. Here is the resulting rule.
With this rule it is possible to access the ServerVariable "HTTP_MANUFACTURER" from C#:
A Different option a friend shared with me is this:
As you can see i rewrite the url and set a parameter which i assign the, by the pattern, filtered value.
I hope this helps somebody else.