If you are using Dreamhost, or other similar shared server host, and are having problems with HTTP authentication then this is something to try. In my case I had a RAILS application where I was positive I was sending the appropriate HTTP Basic Authorization header (from PHP) like so:
$urlNew = curl_init();
...
curl_setopt($urlNew, CURLOPT_USERPWD, $strAuth);
curl_setopt($urlNew, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
...
However the server would repeatedly reply with not authorized (401 error). It turned out that the Authorization header was not being passed from Apache to the FastCGI application. So where I had this rewrite rule in /public/.htaccess:
RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
I just changed it to this:
RewriteRule ^(.*)$ dispatch.fcgi [E=X-HTTP_AUTHORIZATION:%{HTTP:Authorization},QSA,L]
And all was well.

gladyssepulveda | Tue, 2010-06-22 08:36
Best site for quality written essays, term paper, research paper help, course work, book report and resume writing. All writing services are guaranteed written by professional writers.
- Login or register to post comments
»