Is it possible to make the uploaded "original" images unaccessable for site visitors and make only the transforms public?

I'd like to upload images in full quality, to

  1. get the best possible quality out of Craft transforms
  2. make Craft's assets folder basically a backup for my Lighroom library
  3. no manual transforms necessary before upload (Craft does the job anyways for all the required 2x, 1x and thumbnail sizes)

The images should be secure in that folder, otherwise I run into possible copyright problems (images would be in printable size and quality).

1 Answer 1


Since all asset transforms are saved in a sub-directory starting with an underscore, you could simply test for that.




If your asset-folder is above public_html, and the request is routed through Craft, you could create a plugin, which checks for the underscore:

public function init()

    //Is resource request?
    if (craft()->request->isResourceRequest()) {

        //Parent directory
        $parent_dir = dirname(craft()->request->getUrl());

        //Check if parent dir doesn't beginns with an underscore
        if (!preg_match('/^[\/\\]*([_]+)/U', $parent_dir)) {


If your assets can be accessed directly, you'd have to use .htaccess to deny the request. I'm really bad at RewriteConditions, so this would possible be a question for StackOverflow.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.