Jump to content

Password Protect A Directory


The Little Guy

Recommended Posts

Im not 100% sure where I would go and post this question, so Ill post it here.

 

How can I password protect a directory?

 

Once it is password protected here is my question:

 

1. Will people still be able to look at the pictures/music/files in the directory if they know the exact URL (I want people to be able to do this)?

Link to comment
https://forums.phpfreaks.com/topic/51353-password-protect-a-directory/
Share on other sites

As for the first part, it looks like my host has a utility to password protect directories, where you fill out a form, and then after you submit, it creates the .htaccess file for you.

 

The pictures/music/files are in subdirectories of the password protected directory, will they be able to work then?

It sounds just as secure as a password protected directory, to me. Basically I don't want users to see other users images, and if I password protect the users directory, it password protects all the images and files in the actual users files.

 

Example of my structure:

+--index.php
|
+--login.php
|
+--join.php
|
+--images
|    |
|    +--logo.gif
|    |
|    +--bg.gif
|
+--users
     |
     +--index.php
     |
     +--ryan
     |    |
     |    +--img1.jpg
     |    |
     |    +--img2.jpg
     |    |
     |    +--sound.mp3
     |
     +--bob
     |    |
     |    +--img.gif
     |    |
     |    +--song.mp3
     |
     +--tim
          |
          +--movie.mov
          |
          +--song.wma

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.