title: How to add a server variable in IIS
body: <p>I am not very familiar with IIS7 and I need to create a server variable so that I can access it within my PHP code. I can easily accomplish this in Apache by using:</p>
  
  <p>SETENV variable_name variable_value </p>
  
  <p>in the .htaccess file. However accomplishing this in IIS seems to be a bit of a secret. I have looked online for info and the closest thing I can find states using the URL Rewrite Module using these steps:</p>
  
  <ol>
  <li>Clicking on View Server Variables</li>
  <li>Click the Add link and enter the variable name</li>
  <li>Go back to rules and click the View Rewrite Maps</li>
  <li>Click Add Rewrite Map and enter the default value.</li>
  <li>Restarted the server.</li>
  </ol>
  
  <p>Full docs can be found at: <a href="http://www.iis.net/learn/extensions/url-rewrite-module/setting-http-request-headers-and-iis-server-variables" rel="noreferrer">http://www.iis.net/learn/extensions/url-rewrite-module/setting-http-request-headers-and-iis-server-variables</a></p>
  
  <p>I followed that but it still doesn’t work. Any ideas how this is done? Is it even possible to do this in IIS? All I want to do is set up a server variable with a static value.</p>
  
  <p>example: $_SERVER['MY_VARIABLE']</p>
  
  <p>Thanks.</p>