WordPress.org

Ready to get started?Download WordPress

Forums

block folder listing with .htaccess (4 posts)

  1. mugger
    Member
    Posted 4 years ago #

    If top of WP .htaccess has

    # BEGIN WordPress
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    # Prevents directory listing
    IndexIgnore *
    # END WordPress

    does this protect all lower folders from being listed?

  2. Shane G
    Member
    Posted 4 years ago #

    Hi,

    You can add this code in htaccess to prevent directory listing:

    Options -Indexes

    or

    IndexIgnore *

    Thanks,

    Shane G.

  3. mugger
    Member
    Posted 4 years ago #

    Thanks. But does that also protect lower levels?
    Hackers have gotten to some of my index.php in lower levels before I started learning more about wp security.

  4. Shane G
    Member
    Posted 4 years ago #

    Hi,

    If you do not have added any other htaccess file in the lower level folders then it will executes the rules of the main htaccess folder which does not allow to access any of the folder.

    If any htaccess file under the lower level folder then it will execute that rules so you have to add this code in that htaccess file too.

    Thanks,

    Shane G.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.