title: How to set Authorization header using PHP
body: <p>I am using <code>apache</code> basic authentication and which sets up <code>REMOTE_USER</code> header that I my server verifies for allowing in. I am using <code>apache</code> reverse proxy.</p>
  
  <pre><code>ProxyPass /location http://myip:8000/location
  ProxyPassReverse /en-US http://myip:8000/location
  
  &lt;Location /location&gt;
  AuthType Basic
  AuthName "Restricted Files"
  # (Following line optional)
  AuthBasicProvider file
  AuthUserFile /home/tomcat/apache/.htpasswd
  Require valid-user
  
  RewriteEngine on
  RewriteRule .* - [E=RU:%{REMOTE_USER}]
  RequestHeader set X-Remote-User %{RU}e
  RequestHeader set REMOTE-USER %{REMOTE_USER}s
  &lt;/Location&gt;
  </code></pre>
  
  <p>Above solution is working fine. But I need to do same with <code>PHP</code>. Can I send php redirect to /location with headers similar to above authentication headers.</p>
  
  <p>I need to do user authentication with php and after authentication is done I want to let him in with above <code>proxypass.</code></p>