Question : Windows web server: password protect a web directory

I've got a domain that's being hosted on a Windows server running ASP.NET 1.1.4322. I need to password-protect one of the directories under this domain. I originally thought this webspace was in a Linux environment, so I was going to use an .htaccess, but alas...

I'm not really familiar with Windows hosting. Is there by any chance an easy way to go about doing this, that doesn't involve converting every site in that subdirectory to an authentication-enabled ASP.NET app? Something on the order of .htaccess would be wonderful. If it helps, PHP files seem to run correctly within the environment (which is why I originally thought it was Linux), so if there's a stock .php solution, that would work quite nicely as well.

Please advise. Thanks!

Answer : Windows web server: password protect a web directory

Without server access I've never found anything that can protect directories like .htaccess can.  However, there are some good php password protection scripts around.  The trick is that you generally need to include something in every file to be protected.  Depending on how many html files you have that could be trivial or it could be impossible.

Have a look at this script:

http://www.zubrag.com/scripts/password-protect.php

What you could do is simply rename all your .html files to .php and (after configuring it correctly, as per instructions on the website) add the requisite line into each of your pages to be protected.  You'd also need to update any links to those html files to point to the php files instead.

Random Solutions  
 
programming4us programming4us