对于我的 Wordpress 网站,我目前强制所有用户登录以查看任何页面或帖子。例如,任何访问 www.mywebsite.com 或 www.mywebsite.com/a-wordpress-page/ 的人都必须登录才能查看。
但是,目前任何人都可以强制浏览到媒体库中上传的任何文件,而无需登录。例如,任何人都可以访问 www.mywebsite.com/wp-content/uploads/2013/10/myfile.jpg 而无需登录登录。如果可能,我想将它们重定向到登录屏幕。
是否可以保护此 URL?什么是最好的解决方案?提前致谢。
有些事情我已经尝试过,但它们并没有真正奏效......
- http://wordpress.org/support/topic/protect-direct-access-to-uploaded-files?replies=16
- http://stephenharris.info/restricting-direct-access-to-files-in-wordpress
- https://wordpress.stackexchange.com/questions/35226/the-best-way-to-protect-uploaded-media-in-wordpress
- https://wordpress.stackexchange.com/questions/37144/how-to-protect-uploads-if-user-is-not-logged-in
- http://www.digitalaccesspass.com/doc/protecting-regular-site-files/
- http://en.forums.wordpress.com/topic/password-protect-restrict-access-to-files
- http://prestidigitation.commons.gc.cuny.edu/2013/08/11/protecting-uploaded-files-in-wordpress/
- http://www.andrewrollins.com/2008/01/22/wordpress-and-htaccess-password-protected-directories/