title: How to recognize if a request came from URL rewrite module
body: <p>Apologize if the title is not clear, basically I have a web proxy that listening on port 80 and I set up URL rewrite on IIS, (the rule on  web.config as following), it does</p>
  
  <p><a href="http://example.com/api/blah/blah" rel="nofollow">http://example.com/api/blah/blah</a>  -><br>
  <a href="http://example.com:8095/api/blah/blah" rel="nofollow">http://example.com:8095/api/blah/blah</a></p>
  
  <pre><code>  &lt;rule name="api-example" enabled="true" patternSyntax="ECMAScript" stopProcessing="true"&gt;
       &lt;match url="^.*/api/.*$" /&gt;
       &lt;conditions logicalGrouping="MatchAll" trackAllCaptures="false" /&gt;
       &lt;action type="Rewrite" url="http://localhost:8095/{R:0}" appendQueryString="true" logRewrittenUrl="false" /&gt;
    &lt;/rule&gt; 
  </code></pre>
  
  <p>it works fine, no problems, also works when I request localhost:8095 directly</p>
  
  <p>but I'd also like to be able to recognize if a request was directly requested or it was via URL rewrite module.</p>
  
  <p>My idea is, to append a query string onto the URL, when the url gets rewrited on IIS so that I can check if the query string exists then it was via URL rewrite if not, then it's a direct request</p>
  
  <p>examples:</p>
  
  <p><a href="http://example.com/api/blah/blah?from=proxy" rel="nofollow">http://example.com/api/blah/blah?from=proxy</a>  ->
  <a href="http://example.com:8095/api/blah/blah?from=proxy" rel="nofollow">http://example.com:8095/api/blah/blah?from=proxy</a></p>
  
  <p><a href="http://example.com/api/blah/blah?existing_query_string=blah&amp;from=proxy" rel="nofollow">http://example.com/api/blah/blah?existing_query_string=blah&amp;from=proxy</a>  ->
  <a href="http://example.com:8095/api/blah/blah?existing_query_string=blah&amp;from=proxy" rel="nofollow">http://example.com:8095/api/blah/blah?existing_query_string=blah&amp;from=proxy</a></p>
  
  <p>How can I achieve this? or is there any other way to do it?</p>
  
  <p>Many thanks</p>
  
  <p>Ming</p>