title: Login required to view media file uploaded to Wordpress
body: <p>For my Wordpress site, I currently force all users to log in to view any page or post. For example, anyone going to www.mywebsite.com or www.mywebsite.com/a-wordpress-page/ will have to sign in in order to view it.</p>
  
  <p>However, anyone can currently forcefully browse to any file uploaded in the Media Library without needing to log in. For example, anyone can go to www.mywebsite.com/wp-content/uploads/2013/10/myfile.jpg without needing to log in. I want to redirect them to the login screen if possible.</p>
  
  <p>Is it possible to protect this URL? What is the best solution for this? Thanks in advance.</p>
  
  <p>Some things I've tried but they didn't really work...</p>
  
  <ul>
  <li><a href="http://wordpress.org/support/topic/protect-direct-access-to-uploaded-files?replies=16" rel="nofollow noreferrer">http://wordpress.org/support/topic/protect-direct-access-to-uploaded-files?replies=16</a></li>
  <li><a href="http://stephenharris.info/restricting-direct-access-to-files-in-wordpress" rel="nofollow noreferrer">http://stephenharris.info/restricting-direct-access-to-files-in-wordpress</a></li>
  <li><a href="https://wordpress.stackexchange.com/questions/35226/the-best-way-to-protect-uploaded-media-in-wordpress">https://wordpress.stackexchange.com/questions/35226/the-best-way-to-protect-uploaded-media-in-wordpress</a>  </li>
  <li><a href="https://wordpress.stackexchange.com/questions/37144/how-to-protect-uploads-if-user-is-not-logged-in">https://wordpress.stackexchange.com/questions/37144/how-to-protect-uploads-if-user-is-not-logged-in</a></li>
  <li><a href="http://www.digitalaccesspass.com/doc/protecting-regular-site-files/" rel="nofollow noreferrer">http://www.digitalaccesspass.com/doc/protecting-regular-site-files/</a></li>
  <li><a href="http://en.forums.wordpress.com/topic/password-protect-restrict-access-to-files" rel="nofollow noreferrer">http://en.forums.wordpress.com/topic/password-protect-restrict-access-to-files</a></li>
  <li><a href="http://prestidigitation.commons.gc.cuny.edu/2013/08/11/protecting-uploaded-files-in-wordpress/" rel="nofollow noreferrer">http://prestidigitation.commons.gc.cuny.edu/2013/08/11/protecting-uploaded-files-in-wordpress/</a></li>
  <li><a href="http://www.andrewrollins.com/2008/01/22/wordpress-and-htaccess-password-protected-directories/" rel="nofollow noreferrer">http://www.andrewrollins.com/2008/01/22/wordpress-and-htaccess-password-protected-directories/</a></li>
  </ul>