View Full Version : Finding full server paths

07-26-2002, 08:11 PM
I'm trying to create a .htaccess/.htpasswd area on my website - but I don't know the full server path to my file - is there any way to discover this path, or will I have to contact my provider to make them give me the path?
Lastly, what does the "AuthGroupFile /dev/null" line do in the .htaccess file? Is it required?

07-27-2002, 12:55 AM
Hi, to find any path on your server, just throw the script below in any directory (any directory that you can use CGIs in, that is), chmod it 755 and call it from your browser. It will show you the serverpath on your screen :)

print "Content-type: text/html\n\n";
print "<html><head></head><body>\n";
print "Your path is working and pointing to Perl version:<p>\n";
print "<B>$]</B><p>\n";
print "The complete path to this script is:<p>\n";
print "<B>$ENV{'SCRIPT_FILENAME'}</B><p>\n";
print "The relative URL of this script is:<p>\n";
print "<B>$ENV{'SCRIPT_NAME'}</B>\n";
print "</body></html>\n";

About the .htaccess; "AuthGroupFile /dev/null" is the filename containing a list of groups and the users they include. "Null" means it doesn't exist. Not sure if it is required.

07-27-2002, 07:31 AM
Or you could use this ASP code:


07-27-2002, 03:55 PM
Or this php:


08-14-2002, 05:01 AM
I cant get that first perl option to work. Nothing shows up except exactly what is typed. Can anyone tell me how to properly write this in notepad or something like that?