I am trying to protect the uploads directory with .htacess.
But when I browse media section in admin panel, I see user/pass popup.
My guess is, WordPress use fopen
to find if the file exists. I found mod_rewrite rule allowing fopen
but I can’t figure out how to use those rules with basic HTTP authentication. Any help is highly appreciated.
following is the rewrite rules for allowing fopen:
RewriteEngine On
RewriteBase /
RewriteCond %{THE_REQUEST} ^.+$ [NC]
RewriteRule .* - [F,L]
That should help, I think
See this popular answer, it works and is easy to use.
You find the source als oin a Gist.