Wordpress: prevent navigating to files in content folder unless logged in
So I'm working with an installation, and have files in my wp-content/uploads folder. I want to prevent people from navigating to it directly, or accessing it at all (including videos called in a podcast), unless they are logged into the site.
It this a simple htaccess thing? 开发者_StackOverflow中文版I'm not even sure where to start.
Add
Options All -Indexes
to your .htaccess file after the # END WordPress line.
It will prevent people from browsing your folders and display a forbidden message if they try. See:
http://catrabbit.com.au/wp-content/uploads/2010/10/
I misinterpreted the question. Sorry.
To clarify:
This stops everyone (logged in or otherwise) from browsing your folders. I'm not sure why do want to allow logged in users to browse the uploads folder in the first place...
Found a plugin to handle this:
http://wordpress.org/extend/plugins/private-files/
精彩评论