Note that there are some explanatory texts on larger screens.

plurals
  1. POURL rewrite - REMOTE_USER always empty
    text
    copied!<p>I need to create a URL rewrite rule that adds the REMOTE_USER value to the query string. I simplified my app down to absolute essentials. However, the REMOTE_USER is always empty while the rule condition is evaluated. </p> <p>My web site configured in IIS 7, app pool uses integrated mode with .NET 2.0. I disabled Anonymous Auth and enabled Windows Auth on the site through IIS Manager and I even added the line to web.config to prevent anonymous access. Here are my two files.</p> <p>web.config:</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;configuration&gt; &lt;system.webServer&gt; &lt;security&gt; &lt;authorization&gt; &lt;remove users="?" roles="" verbs="" /&gt; &lt;/authorization&gt; &lt;/security&gt; &lt;rewrite&gt; &lt;rules&gt; &lt;clear /&gt; &lt;rule name="Add login into URL" stopProcessing="true"&gt; &lt;match url=".*" /&gt; &lt;conditions logicalGrouping="MatchAll" trackAllCaptures="true"&gt; &lt;add input="{QUERY_STRING}" pattern="login" negate="true" /&gt; &lt;add input="{REMOTE_USER}" pattern="(.*)" /&gt; &lt;/conditions&gt; &lt;action type="Redirect" url="{HTTP_URL}?login={C:1}" redirectType="Temporary" /&gt; &lt;/rule&gt; &lt;/rules&gt; &lt;/rewrite&gt; &lt;/system.webServer&gt; &lt;/configuration&gt; </code></pre> <p>default.asp</p> <pre><code>&lt;%= Request.ServerVariables("REMOTE_USER") %&gt; </code></pre> <p>My rule never hits because {REMOTE_USER} is always blank when conditions are evaluated (other server variables show up in the rule, so it's just {REMOTE_USER}). The twist is that default.asp shows my REMOTE_USER value. </p> <p>Any suggestions why this happened? Thank you</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload