www.webdeveloper.com
Results 1 to 4 of 4

Thread: How do I prevent someone from viewing a directory?

  1. #1
    Join Date
    Mar 2010
    Posts
    701

    How do I prevent someone from viewing a directory?

    If someone goes to a directory in my website without a index.php on a browser, he can view all of the files in that directory.
    Are there ways to prevent this? (other than adding a index.php)

  2. #2
    Join Date
    Sep 2010
    Posts
    62
    The easiest way to do this is to edit the .htaccess in the root directory of your website. Add
    Code:
    Options -Indexes
    to the file. This will disable directory listing in every directory of your website.

  3. #3
    Join Date
    Mar 2010
    Posts
    701
    This returns a 404 page right? Thanks.

  4. #4
    Join Date
    Sep 2010
    Posts
    62
    Turning off directory listing will cause a 403 unauthorized to be returned.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles