WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] How does WordPress prevent directory listing? (4 posts)

  1. Neil
    Member
    Posted 2 years ago #

    Hi,

    I normally use .htaccess to prevent directory listings using the following:

    Options -Indexes

    Can you please explain how WordPress handles this without the use of a .htaccess file?

    For example, when you try to go to http://www.mysite.com/wp-admin/css/ it gives a 403 error.

  2. Options -Indexes

    Can you please explain how WordPress handles this without the use of a .htaccess file?

    WordPress doesn't: that's a configuration on the web server. That option also works if you put it into the web server's httpd.conf or equivalent which is where most of us have that configured.

    Directory listings are not good. ;)

  3. Neil
    Member
    Posted 2 years ago #

    Thanks. I always thought WordPress had an internal mechanism to prevent directory listings, now after your reply and checking some more WordPress sites, I see that it doesn't.

  4. MickeyRoush
    Member
    Posted 2 years ago #

    Well, I'm not sure if this counts, sometimes there are blank index.php files in directories like the wp-content/themes/ directory.

    <?php
    // Silence is golden.
    ?>

Topic Closed

This topic has been closed to new replies.

About this Topic