Forums

[resolved] How to block acess to folders? (4 posts)

  1. comedorsamus
    Member
    Posted 6 months ago #

    Sorry, I don't know how this is called. :P

    For example, if anyone type "http://mywebsite.com/banners/" they can freely browse through folders and files, so I'd like to block this kind of access.

    Not only one folder, but every single one. Can someone please tell me how?

  2. ClaytonJames
    Member
    Posted 6 months ago #

    Add "Options -Indexes" to the very top of your .htaccess file.

    Without the quotation marks, of course. :-)

  3. comedorsamus
    Member
    Posted 6 months ago #

    Options -Indexes
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END WordPress

    http://codex.wordpress.org/Using_Permalinks#Creating_and_editing_.28.htaccess.29

    Thanks CJ!

  4. ClaytonJames
    Member
    Posted 6 months ago #

    You're welcome!

Reply

You must log in to post.

About this Topic

Tags