I'm working on a Rails app and using the restful-authentication plugin. The app will include user images. Only users who log in will be able to browse, but I wondered if I can also restrict direct URL access to the images to only allow logged-in users.
In other words, even if you know that an image is at thesite.com/user1/foo.jpg
, you can't see that image unless you're logged in. I know this could theoretically be done in the Apache config, but the only way I know would involve manual editing of those files, which wouldn't scale.
Is this possible? Would it make more sense to just move the photos out of the public
directory? (I'm not sure if that has any performance implications, as public
is generally used for static content.)