• Resolved Robert Eichhorn

    (@robert-eichhorn)


    I’ve found 2 different examples of .htaccess code to prevent directory browsing and disable directory listing. One code uses [ Options All -Indexes ] and the other code uses [ Options -Indexes ]. Here are the examples:

    Example (1)
    # BEGIN Prevent Directory Browsing
    Options All -Indexes
    # END Prevent Directory Browsing

    Example (2)
    Options -Indexes

    My questions are:
    1. What is the difference between the 2 different codes?
    2. Which code should I use to prevent directory browsing and disable directory listing?

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    Options All invokes all options, then the subsequent -Indexes revokes the indexing (directory listing) option. Unless you’re really sure you want all other options, I recommend the version without.

Viewing 1 replies (of 1 total)
  • The topic ‘Questions about .htaccess code (4)’ is closed to new replies.