1

I am pretty familiar with IIS and URL Rewrite but I just got a task which stumped me. I need to check each request for the presence of the X-Forwarded-For HTTP header and, depending on its presence, redirect the request.

How can I check for this header?

1 Answer 1

5

Try something like the following:

<rewrite> <rules> <rule name="RedirectBasedOnForwardedFor" patternSyntax="Wildcard" stopProcessing="true"> <match url="*" /> <conditions> <add input="{HTTP_X_Forwarded_For}" pattern="insert your pattern here" /> </condiations> <action type="Redirect" url="/newurl/" /> </rule> </rules> </rewrite> 
1
  • This definitely led me in the right direction. Thanks! Commented Oct 29, 2013 at 21:10

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.