readfile() and 401 pages
| From: | Vince LaMonica | Date: | Fri, 16 Jan 2004 22:07:41 +0000 |
| Subject: | readfile() and 401 pages | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-174890@lists.php.net to get a copy of this message | ||
Hi all,
I'm attempting to use readfile() to redirect the user to a .htaccess
protected page:
<?php
readfile("https://www.foo.edu/cgi-bin/stats/awstats?config=more.foo.here");
?>
The stats/ directory is .htaccess'ed. [and the URL is even longer, with a
lot of other options tagged onto the awstats call]. I would like to be
able to redirect users to a simplier URL:
https://www.foo.edu/stats/site
and have the 'authorization required' browser dialog box pop up when going
there [like it does when they visit the long/normal URL].
Instead, what I'm getting back is a PHP error stating that HTTP/1.1
Authorization Required in line 2 of the above page. Does readfile() not
pass along 401s to the browser? I know I can do an alias in apache's
setup, which is what I plan on doing if readfile() can't be made to work.
But I am curious if this is a limitation or design in readfile().
TIA,
/vjl/
--
Vince LaMonica UC Irvine, School of Social Ecology
W3 Developer <*> 116 Social Ecology I, Irvine, CA 92697
vjl@uci.edu http://www.seweb.uci.edu/techsupport
Information wants to be free.
Rent wants to be paid.