Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to hide or disable directory listing via htaccess - Linux

    • 0
    • 1
    • 1
    • 1
    • 0
    • 0
    • 0
    • 0
    • 638
    Comment on it

    It's hard to believe in coincidence but the truth is that lot of developers including senior ones, don't know or bother about this security issue.


    A lot of times we found that we can see list of all Images, CSS, JavaScript files hosted on server via hitting direct path of these assets folder. so to restrict user to access these files directly, you simply need to add this line (mentioned below) in your .htaccess file to hide the directory listing.


    Options -Indexes -FollowSymLinks


    Example

    1. Create ".htaccess" file if not exist in your root directory.
    2. Paste this code "Options -Indexes -FollowSymLinks" in your ".htaccess" file
    3. Save the file.

    Happy Coding!!

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: