|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-07-14 08:58 UTC] sniper@php.net
[2005-07-22 01:00 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 08:00:01 2025 UTC |
Description: ------------ When using fopen() it seems that authentication details are not passed through upon a redirect and you will get a HTTP/1.1 401 Authorization Required. The server i am trying has a virtual host of the following... <VirtualHost 0.0.0.0:80> ServerName some.redirect.com RewriteEngine on RewriteRule ^/(.*) http://www.redirect.com/redirect/$1 [R,L] </VirtualHost> Which will just redirect the request to another location where authentication is needed. Reproduce code: --------------- <?php $fp = fopen('http://user:pass@some.redirect.com/', 'rb'); print_r($fp); ?> Expected result: ---------------- Resource id #2 Actual result: -------------- PHP Warning: fopen(): HTTP request failed! HTTP/1.1 401 Authorization Required