HTACCESS or other directory level password system needed

I have a directory that I would like to limit access to. Right now, I have a java applet that requires a password, but of course, once in, they can bookmark the page. I'd like to add something like htaccess to limit access.

My host is using a Windows box, and I know that htaccess is usually limited to Unix and Apache.

Anyone have ideas? Turnkey solutions would be great - I'm bright, but lack of time is a big concern. If not, detailed instructions would be great as well

Greatly appreciated.

Marc
mcstevenAsked:
Who is Participating?
 
blainehiltonConnect With a Mentor Commented:
Well you could code a solution in Windows native ASP, or in PHP.  I would check out www.hotscripts.com and go to ASP and then Password Protection.

You are correct that .htaccess files are limited to unix, and I believe just the Apache server.  If you want to do something like .htaccess though Windows IIS supports the same basic thing, except I believe you set it up through the server and tell the server which directory it is in.

Hoped that helped

--
Blaine Hilton
0
 
zerofillConnect With a Mentor Commented:
I httpd.conf you must create something like this:

<Directory /path/to/your/directory>
    ....
    AllowOverride All
    ....
</Directory>

AccessFileName .htaccess #or whatever you want

#uncomment this lines:
LoadModule auth_module modules/mod_auth.so



create .htaccess file in your directory with contents:

AuthName "restricted"
AuthType Basic
AuthUserFile "D:\bin\Apache2\conf\.pass" #or where you password file is
<LIMIT GET POST>
require valid-user
</LIMIT>

Go to path/to/Apache/bin directoy and run "htpasswd.exe [-c to create new file].pass username". See help for more optins
Copy .pass to where your path is (defined in .htpasswd)

This must work
Let me know id something is wrong or I have missed something

p.s. If you don't get a window asking for username and password, possible reason is that you have AllowOverride None somewhere in httpd.conf that applies to the desired folder.
0
All Courses

From novice to tech pro — start learning today.