www.webdeveloper.com
Results 1 to 2 of 2

Thread: .htaccess to limit file access - APACHE

  1. #1
    Join Date
    Apr 2007
    Location
    Seattle, WA
    Posts
    53

    .htaccess to limit file access - APACHE

    I'm looking for a code snippit to allow access into a folder ONLY through a webpage.

    I have, what is essentially, a flash gallery and I'd like the photos/videos to only be accessible if requested from the flash.

    Does anyone have a good understanding of APACHE and/or a sample of how to do this. I'm assuming it's a fairly simple task, I'm just not familiar enough with APACHE to do it.

    Thanks in advance.
    Ryan

  2. #2
    Join Date
    May 2004
    Location
    FL
    Posts
    3,453
    This should help you <from: http://perishablepress.com/press/200...access-tricks/>:
    Prevent Unauthorized Directory Browsing [ ^ ]

    Prevent unauthorized directory browsing by instructing the server to serve a xxx Forbidden - Authorization Required message for any request to view a directory. For example, if your site is missing its default index page, everything within the root of your site will be accessible to all visitors. To prevent this, include the following htaccess rule:

    # disable directory browsing
    Options All -Indexes

    Conversely, to enable directory browsing, use the following directive:

    # enable directory browsing
    Options All +Indexes

    Likewise, this rule will prevent the server from listing directory contents:

    # prevent folder listing
    IndexIgnore *

    And, finally, the IndexIgnore directive may be used to prevent the display of select file types:

    # prevent display of select file types
    IndexIgnore *.wmv *.mp4 *.avi *.etc

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