SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Zealot
    Join Date
    Dec 1999
    Location
    Highlands Ranch, CO
    Posts
    193
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok. I am now working at a company that is set up using NT servers (in house). I need to know how I can configure the NT box to behave like my 'hosted' vserver, so that I can make .htaccess files to control directories (passwords, etc). Is there a tutorial someplace for this that I can read over? Again, they don't have anything set up on their boxes to control this. I am Unix oriented, but not an IT wiz.

    Any help is appreciated!

    Chad

  2. #2
    SitePoint Wizard
    Join Date
    Apr 2000
    Posts
    1,483
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't think its possible to use .htaccess on NT - maybe installing Apache will make it possible but as far as I know there is no way.
    I ran into the same problem recently and changed to using PHP's authentication header stuff (I can give you some code if you want to try that)

  3. #3
    SitePoint Zealot
    Join Date
    Dec 1999
    Location
    Highlands Ranch, CO
    Posts
    193
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That would be great! If you like you can email it to: fantasysportsindex@yahoo.com

    I really appreciate the help. I'll check it out.

    Chad

  4. #4
    SitePoint Wizard wdmny's Avatar
    Join Date
    Jul 2000
    Location
    Here
    Posts
    1,010
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can't do anything with something like .htaccess, but N2/2000 has some config tools that let you block access, give access, password, etc...directories, etc...

  5. #5
    SitePoint Wizard
    Join Date
    Apr 2000
    Posts
    1,483
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    I'm very sorry but I forgot to send your email I was having a few email probs at the time and forgot to send this one after they got sorted out.
    The code is below:

    Code:
    <?PHP
    
    // include this file where you want to limit access. 
    
    $username =  "test";
    $password =  "123";
    
    function authenticate() {
      Header( "WWW-authenticate: basic realm=\"Protected\"");
      Header( "HTTP/1.0 401 Unauthorized");
      echo   "You must enter a valid login ID and password!\n";
      exit;
    }
    
    function CheckPwd($user,$pass) {
      global $username,$password;
      return ($user != $username || $pass != $password) ? false : true;
    }
    
    if(!isset($PHP_AUTH_USER)) {
      authenticate();
    }
    elseif(!CheckPwd($PHP_AUTH_USER,$PHP_AUTH_PW)) {
      authenticate();
    }
    ?>
    
    <html>
    <head>
    <title>Authentication System</title>
    </head>
    <body bgcolor="#FFFFFF">
    <font face="Verdana, Arial" size="2"><b>Welcome,</b></font>
    <hr size="1" width="300" align="left">
    <font face="Verdana, Arial" size="2">You have
    authenticated successfully!</font>
    </body>
    </html>


Bookmarks

Posting Permissions

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