how to protect the whole directory using .htaccess for windows 2000 machine? I do know .htaccess for linux but it doesn't work? what's the best solution?

    Try google, im sure you can find some info about this.. and does it make such a diff. with a windows based apache?

      I use .htaccess on a Win2k server without a problem. It was a bit tricky to get setup, but after combing through the documentation, I figured it all out.

      The biggest issues were Windows-specific, such as things like spaces in directory names, and using quotes in the right places in your .htaccess.

      --Brad Fears

        AuthType Basic
        AuthName "protected area"
        AuthUserFile C:\\Inetpub\\php-bin\\.htpasswd
        require valid-user

        what's wrong with this?

          C:Inetpubphp-bin.htpasswd

          doesn't look like a valid windows path to me...

            can't print backslash on this forum

            its c: \ inetpub \ ....

              ok, sorry. I didn't know that thing with the backslashes.

              my own htaccess files look like this:

              AuthName        "Web Database Access"
              AuthType        Basic
              AuthUserFile    /wwwroot/include/.htpasswd
              
              <Limit GET POST PUT>
              require valid-user
              </Limit>
              

              maybe it's the missing "<limit>" that causes your problems?

                still it does not work... 🙁

                
                AuthName        "Web Database Access"
                AuthType        Basic
                AuthUserFile  C:/Inetpub/php-bin/.htpasswd
                
                <Limit GET POST PUT>
                require valid-user
                </Limit>
                
                

                I tried both slash and backslash

                  Did you create the .htpasswd file on the Windows machine or did you just copy the .htpasswd file from your Linux box?

                    Originally posted by jerdo
                    Did you create the .htpasswd file on the Windows machine or did you just copy the .htpasswd file from your Linux box?

                    windows machine. please note that the directory i want to protect is an alias...

                      How about this:

                      AuthUserFile "C:\Inetpub\php-bin.htpasswd"

                      And what do you mean it's an alias?

                        Originally posted by brad_fears
                        How about this:

                        AuthUserFile "C:\Inetpub\php-bin.htpasswd"

                        And what do you mean it's an alias?

                        it does not work 🙁

                        what i mean is /php-bin/ path is outside of my wwwroot. My WWWROOT directory is c:\inetpub\wwwroot\ while /php-bin/ path is on c:\inetpub\php-bin\

                          I'm looking over my own .htaccess files, and the only difference is that I don't use the <limit> tags. I also specify a particular user.

                          AuthName "Web Database Access"
                          AuthType Basic
                          AuthUserFile "C:/Inetpub/php-bin/.htpasswd"
                          require user <specify username>

                            it does not work 🙁

                            do i have to change my httpd.conf file?
                            <directory>
                            </directory>

                              That depends -- what's in your <directory> for the directory in question?

                              Mine has something like this:

                              <Directory "C:/Inetpub/php-bin">
                              Options Indexes MultiViews
                              AllowOverride FileInfo AuthConfig Limit Options
                              Order deny,allow
                              Deny from all
                              Allow from <ipaddress or mask>
                              </Directory>

                                thanks! finally... the system had prompted for username 🙂

                                but it rejects my password 🙁

                                  What happens if you reset the password? If that doesn't work, what did your <directory> end up looking like?

                                    i used this codes on my httpd.conf

                                    <Directory "C:/Inetpub/php-bin">
                                    Options Indexes MultiViews
                                    AllowOverride FileInfo AuthConfig Limit Options
                                    Order deny,allow
                                    Deny from all
                                    Allow from <ipaddress or mask>
                                    </Directory>

                                    what do you mean by "What happens if you reset the password?" ?

                                      I'm assuming you have the correct ip address or address mask in place of the <ip address or mask>...

                                      As for resetting your password, I meant using the 'htpasswd' script to change the password of the user account you're going to access with. It's in the Apache documentation. In fact, everything we've pointed out here is in the documentation. Have you read the documentation?