Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Cei
    Cei is offline
    New to the CF scene
    Join Date
    Jul 2002
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Finding full server paths

    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?

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    NL
    Posts
    421
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

    Code:
     #!/usr/local/bin/perl
    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";
    exit;
    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.

  • #3
    Rockstar Coder
    Join Date
    Jun 2002
    Location
    USA
    Posts
    9,074
    Thanks
    1
    Thanked 328 Times in 324 Posts
    Or you could use this ASP code:

    <%=Server.MapPath%>
    OracleGuy

  • #4
    Regular Coder
    Join Date
    Jun 2002
    Location
    North East England
    Posts
    853
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Or this php:

    <?=$DOCUMENT_ROOT;?>
    [+] Computer/PC issues [+] Silverpaw3D
    ------------------------------------------------
    Never buy a dwarf with learning disabilities...

    ...it's not big, and it's not clever.

  • #5
    New to the CF scene
    Join Date
    Aug 2002
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •