using htaccess to restrict wp-content access from the browser

  • Author
  • #201573



    i’ve just been playin g the whole day with the .htaccess file to get the most accurate configuration. my goal is to block the access to the wp-content folder from the browser.

    i’m not so familiar with rewrite rules and i’m not so happy with the result, i think that i can be done in a cleanest way,

    Actually i added a blank index.php files to any folder inside wp-content and write a rule for any of the folders that looks like this:

    Redirect 301 /wp-content/index.php

    I think that this can be done in a better way because this solution doesn’t cover the full access to the folders. And when I tried to aply te rule directly to the folder, as you can imagine, some of the plugins that i’m using or even the upload module stop to run because the server is redirecting any request to this folder.

    I was just wondering if someone can point my in the right way.




    I think you’re in the wrong forum. This is for blogs; you sound like you’re self-hosted using software. Our blogs work differently; if you ask over at they should be able to help you.



    ups sorry i just thought that i was on support… i’m gonna check there.

    If someone can delete the comment it would nice.

The topic ‘using htaccess to restrict wp-content access from the browser’ is closed to new replies.