I am using a Windows based site. How can I protect a subdirectory from casual access?
Thanks.
I am using a Windows based site. How can I protect a subdirectory from casual access?
Thanks.
What sort of casual access? If you are looking to create password protected directories, that is unfortunately only available on Windows.
Yash, I think you mean Linux.
Make an index.html page in that directory with one html body line: “Go away!” ![]()
-Dave
[QUOTE=Yash]
What sort of casual access? If you are looking to create password protected directories, that is unfortunately only available on Windows.
[/QUOTE]
I am on Windows and a password protected directory will be just fine. But, I thought you meant linux in above reply:) Thanks.
Oh, I’m sorry. I meant only Linux
On windows, you can just use a simple asp script to password protect a directory and then redirect if they’re not logged in. If you need I code like this I will be glad to post one.
[QUOTE=Bliss]
On windows, you can just use a simple asp script to password protect a directory and then redirect if they’re not logged in. If you need I code like this I will be glad to post one.
[/QUOTE]
Yes, please do. I’d love to get a solution. Thanks!
How many usernames/passwords do you need? One or more than one?
I’m dying to see the script too
Just curious
[QUOTE=Bliss]
How many usernames/passwords do you need? One or more than one?
[/QUOTE]
Just one. I just want to prevent a casual access to the folder. Thanks.
[font=Arial]This is a simple login page and you can name it whatever.asp and put it anywhere on your site. Just a script I found somewhere. Change the stuff in extra bold to what you want.[/font]
[font=Arial]<%@ LANGUAGE=“VBSCRIPT” %> [/font]
[font=Arial]<%
Response.Buffer = True
STATUS = Request(“STATUS”)
PASSWORD = Request(“PASSWORD”)[/font][font=Arial][b]
If STATUS = “CHECKEM” Then
If PASSWORD = “[font=Arial Black]sample[/font]” THEN
Session(“PASSWORDACCESS”) = “Yes”[/b][/font]
[font=Arial][b]Response.Redirect(“[font=Arial Black]youpage[/font].[font=Arial Black]asp[/font]”)
End If
End If
If Session(“PASSWORDACCESS”) <> “Yes” Then
%>
[font=Arial]Now on all the pages you want to protect (The extension must be .asp), write[/font]
[font=Arial]<%[/font]
[font=Arial]If Session(“PASSWORDACCESS”) <> “Yes” Then[/font]
[font=Arial]Response.Redirect(“[font=Arial Black]Unauthorised.htm[/font]”)[/font]
[font=Arial][b]End If
[/b][/font][font=Arial]%>[/font]