View Full Version : How do I password protect a folder?
bellgamin
02-18-2003, 09:35 PM
A) Here's a hypothetical URL for purposes of discussion. I added spaces so it won't look like a real link...
h t t p: // w w w . mydomain / filefolder / filename.zip
B) If my friend Fred enters the above URL in his browser, it will download filename.zip to Fred's computer. This is GOOD! Fred is my friend & I want him to be able to download stuff from *filefolder*.
C) What I do NOT want is for Mad Dog Monty, a demented hacker, to somehow discover the above stated URL & proceed to download filename.zip 14,632 times, thereby running my bandwidth into the ionosphere.
D) Please -- in words that a slightly dull 5-year-old could understand -- give me step-by-step instructions as to how I can password protect *filefolder* so that no one can access its contents unless he/she knows aforesaid password.
REMEMBER -- you cannot possibly underestimate my capacity for screwing up even the simplest of instructions. :rolleyes:
admin
02-18-2003, 10:08 PM
I will start by offering you the link in the documentation that provides for the function you are looking for:
http://www.cpanel.net/docs/cp/webProtectDirectories.htm
The documentation seems simple enough, but if more is required, please submit a helpdesk ticket with the folder and the usernames and passwords and we will be happy to set it up for you.
bellgamin
02-18-2003, 11:22 PM
Jah, das link vas goot!
Danke.
I can do it.
admin
02-18-2003, 11:26 PM
Ok, bell, just let me know if you need anything else.
Rodzilla
02-18-2003, 11:35 PM
Can I get fries with that?
Gnomercy
02-19-2003, 12:25 AM
No, but we have a lovely hot apple pie.
Disclaimer: The hot apple pie is served at 4,562,018 degrees Farenheit (2534436.6666667 degrees Celsius) and must be allowed to cool before eating. We recommend that you not touch the pie with any part of your body or place it on the seat of your car as it might melt through your flesh or the seat of your car and the pavement underneath. We claim no responsibility for any injury that may be caused. Consumer waives any right to legal action by purchasing pie.
spence
02-20-2003, 06:36 PM
So...along this same line (.htaccess--not apple pies--later!)...
let's say I have two directories I want to protect, but I only want a visitor to my site to have to log-in once to gain access to both directories...
outside of placing everything I want to protect under one "master" directory...is there a way to do the above?
thanks for info!
Rodzilla
02-20-2003, 06:56 PM
Give them both the same name.
admin
02-20-2003, 10:42 PM
Originally posted by Rodzilla
Give them both the same name.
What are you talking about Rod?
I would actually try copying the .htaccess from one folder to the other, this will keep the same security settings and should prevent a second login....or make the send directory a subdirectory of the first one.
Rodzilla
02-20-2003, 11:38 PM
Enter the name that you want to appear in the Protected Resource Name field. This is optional and purely for the user's benefit.
Give 'em the same name. I could be wrong though, but that's how I do it via .htaccess...never used Cpanel to do it before.
Afkamm
02-22-2003, 04:10 PM
If .htaccess doesn't work, you could always try PHP and cookies (or both).
1. User accesses php page and enters name/password.
2. PHP checks name/password with those in database (htaccess file, mysql), if match then it sets cookie.
3. PHP page with file links checks for cookie, if it does not exist then it doesn't display the page.
Marc :-)
Rodzilla
02-22-2003, 10:00 PM
PHP's built in authentication gives me the same pain in my gut as its built in session handling... ;)
Afkamm
02-23-2003, 12:42 AM
I'm adding a very simple log in for my site, taking me ages to figure it all out lol I'm no PHP/Mysql expert :(
Sessions is way over the top so i'm just storing username and password in a mysql database and using basic cookies to check if they're logged in or not. I'm getting there, slowly but surely :)
Marc :-)
vBulletin® v3.8.1, Copyright ©2000-2010, Jelsoft Enterprises Ltd.