Question:

.htaccess directory?

by Guest59034  |  earlier

0 LIKES UnLike

I have a folder called /shared/ on my webserver, it has all my images, scripts- the lot in it. How would I stop people from viewing my files without having to put an index.php file in each directory. I would like to use .htaccess so that it pulls them back to my homepage or another designated page.

 Tags:

   Report

3 ANSWERS


  1. Here is a website that allows you to password protect your folder/website using .htaccess.  It shows various methods so you can choose which best fits what you're looking for.

    http://www.askapache.com/htaccess/apache...


  2. Use apache rewrite engine to redirect any request to your images or script files in /shared directory to designated location. Please refer to apache documentation for details and examples

  3. is not possible

    when user views HTML page, their browser also retrieves images, scripts etc used in the page

    there is literally no difference between that, and the user entering the image url directly

    so if u block direct access to these resource, they cant be used on the web page either

    if what u mean is u dont want people to see the index of files when going to the /shared/ directory, then yes u can use .htaccess file to disable directory listing. u can use line:

    Option -Indexes
You're reading: .htaccess directory?

Question Stats

Latest activity: earlier.
This question has 3 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.