Title: Problems disabling directory browsing
Last modified: August 19, 2016

---

# Problems disabling directory browsing

 *  [Something Something Life](https://wordpress.org/support/users/something-something-life/)
 * (@something-something-life)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/problems-disabling-directory-browsing/)
 * So I wanted to block directory browsing for my site to avoid visitors from seeing
   all my files and folders. I found numerous places online that suggested adding
   the following text to the .htaccess file: “Options -Indexes” or “Options All-
   Indexes”. I added this to the .htaccess file and uploaded it. And it worked! 
   Sort of.
 * Now, when I typed the address for a directory ([http://mywpsite.com/junk](http://mywpsite.com/junk))
   I get forwarded to my host’s 404 page ([http://error404.000webhost.com/](http://error404.000webhost.com/)?),
   rather than my own 404 page. This is almost as bad as the original situation,
   because now I’m moving visitors away from my site completely!
 * I kept searching for answers and saw that another option was to put a blank index.
   html file in the folders/directories I want to block. This seemed like maybe 
   it isn’t as secure as the previous solution, but still seemed like it would do
   the trick. I created this file and uploaded it, and changed “Options -Indexes”
   to “Options +Indexes” in my .htaccess file. Now I’m getting my custom index.html
   page (after some hand-wringing and cookie clearing during which my entire site
   disappeared).
 * What I want to know is how I can both block directory browsing and redirect visitors
   to my custom page. Is my current solution secure enough? Is the forced redirect
   a quirk of my (free) host, or will that happen regardless of the host I use? 
   I want to make sure my visitors get a smooth, unified experience, but I also 
   want to make sure my site is secure.

Viewing 1 replies (of 1 total)

 *  [ocpplus](https://wordpress.org/support/users/ocpplus/)
 * (@ocpplus)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/problems-disabling-directory-browsing/#post-2016464)
 * There is a plug in that can handle re-directs easily, there is also another that
   can block serps and bots. I will see if I can remember the name but it might 
   pay to search for it in the meantime.

Viewing 1 replies (of 1 total)

The topic ‘Problems disabling directory browsing’ is closed to new replies.

## Tags

 * [browsing](https://wordpress.org/support/topic-tag/browsing/)
 * [htaccess](https://wordpress.org/support/topic-tag/htaccess/)
 * [Indexes](https://wordpress.org/support/topic-tag/indexes/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [ocpplus](https://wordpress.org/support/users/ocpplus/)
 * Last activity: [15 years, 1 month ago](https://wordpress.org/support/topic/problems-disabling-directory-browsing/#post-2016464)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
