Welcome to the JaguarPC Community
JaguarPC
Sales: (888) 338-5261
Support: (888)-551-3050
Results 1 to 5 of 5

This is a discussion on How to prevent browsing directory ? in the Shared & Semi-Dedicated forum
Hi all, I'm using shared hosting in JaguarPC, and I want others can't browser my directory, they can only see the web pages by links ...

  1. #1
    JPC Member
    Join Date
    Nov 2007
    Posts
    33

    Arrow How to prevent browsing directory ?

    Hi all,

    I'm using shared hosting in JaguarPC, and I want others can't browser my directory, they can only see the web pages by links in browser.

    Can you give me solution ? Thanks

    Regards

    Thang Nguyen

  2. #2
    Yeah, I know a LOT! Vin DSL's Avatar
    Join Date
    Mar 2003
    Location
    Arizona Uplands
    Posts
    10,775
    I put the following in the root .htaccess file (/public_html/ directory):

    Code:
    # NO FILES will be listed in folders, even if index files are missing.
    Options -Indexes
    Give it a try: http://www.lenon.com/public/
    DISCLAIMER Any resemblance between the views expressed above and those of the owners and operators of this system is purely coincidental. Any resemblance between these views and my own are non-deterministic. The existence of Vin DSL is questionable. The existence of views in the absence of anyone to hold them is problematic. The existence of the reader is left as an exercise in the second-order coefficient.

    No Guts, No Story! VinDSL © 2010

  3. #3
    JPC Member
    Join Date
    Nov 2007
    Posts
    33
    Thanks Vin DSL,
    I made .htaccess file and uploaded to folder i want to prevent, however then I can't access files by web browser. I checked in Error Log and its error is .htaccess:
    Invalid command '\xef\xbb\xbfOptions', perhaps mis-spelled or defined by a module not included in the server configuration
    Thanks

    Regards

  4. #4
    Community Leader jason's Avatar
    Join Date
    Sep 2001
    Location
    Rochester, NY
    Posts
    6,003
    The .htaccess file contents should only contain "Options -Indexes" (without the quotes). It looks as though you are trying to specify a path within that file and that is incorrect. As a security precaution, Apache prevents any access to the content controlled by an .htaccess file when there is an error in the .htaccess.

    .htaccess files apply to the directory in which they reside and any directories below that directory and are cumulative, so an .htaccess file placed at the top of your site will control the entire site, a second placed at /services will control /services/abc, /services/def, etc.

    --Jason
    Jason Pitoniak
    Interbrite Communications
    www.interbrite.com www.kodiakskorner.com

  5. #5
    JPC Member
    Join Date
    Nov 2007
    Posts
    33
    Thanks alot, Jason. Problem was fixed.

Bookmarks

Posting Permissions

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