Password protect a folder not a page

©

©®

I know you can password protect a webpage but is it possible to protect
a folder on a website e.g. /www/myown/ that only has other files in it
and not any html files?
Am thinking of storing a few personal files I may need access to when
travelling and may not always have a USB memory key or other media
available.
Any help/tips/suggestions appreciated.

Can use PHP on the server if that means anything.
 
D

David Dorward

©® said:
I know you can password protect a webpage but is it possible to protect
a folder on a website e.g. /www/myown/ that only has other files in it
and not any html files?

HTTP makes no distinction between HTML documents and other resources (well,
aside from when it tells the client what type of data it is sending). You
password protect any resource in the same way.
 
©

©®

David said:
HTTP makes no distinction between HTML documents and other resources
(well, aside from when it tells the client what type of data it is
sending). You password protect any resource in the same way.

Thanks for the input. As I am a newbie, is there a tutorial where I can
learn about how to do it?
Thanks
 
D

David Dorward

©® said:
Thanks for the input. As I am a newbie, is there a tutorial where I can
learn about how to do it?

Most web servers have password protection built in. The specifics depend on
the server. The manual is your friend.
 
A

Alan J. Flavell

Thanks for the input. As I am a newbie, is there a tutorial where I can
learn about how to do it?

If you're using an apache-based server, as most people are, you would
do well to familiarise yourself with what documentation it offers.
It's very good, and definitely more accurate than many poorly-
researched attempts to pre-digest it for those who are too nervous to
look at the real thing.

Depending on which httpd version you use, take a look at

http://httpd.apache.org/docs/1.3/
http://httpd.apache.org/docs/2.0/

The link to the tutorial on "Authentication, Authorization, and Access
Control" would be hard to miss.
 
F

finalwebsites.com

©® said:
I know you can password protect a webpage but is it possible to protect
a folder on a website e.g. /www/myown/ that only has other files in it
and not any html files?
Am thinking of storing a few personal files I may need access to when
travelling and may not always have a USB memory key or other media
available.
Any help/tips/suggestions appreciated.

Can use PHP on the server if that means anything.

Hello,

Protect the folder with .htaccess and open the file for each user while
php file functions.

check the download function on this page:
http://www.finalwebsites.com/snippets.php?id=10

regards Olaf
 
©

©®

If you're using an apache-based server, as most people are, you would
do well to familiarise yourself with what documentation it offers.

My provider is using Apache but I have no input/control over what he has
set things up with. So...as a user, is there anything I can do to stop
access to a certain directory unless the password is known?
 
S

Steven

My provider is using Apache but I have no input/control over what he has
set things up with. So...as a user, is there anything I can do to stop
access to a certain directory unless the password is known?

Apache checks for a file called '.htaccess' in each folder (this check
can be disabled but probably isn't) and this file can specify things
like passwords for access. So, check the documentation, create the
file, and upload it to the required folder. The Apache documentation is
good but I have never protected a folder so I can't really offer any
more info.

-- Steven
 
K

kchayka

Steven said:
The Apache documentation is
good but I have never protected a folder so I can't really offer any
more info.

The Control Panel of your hosting service account may list an option to
password-protect a directory, among other things. I know CPanel usually
has one.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top