hide/protect original full-size images

I was looking for a way to do this and found this page… then I thought of putting this in a .htaccess file in the WordPress uploads folder and it works for me so far… any good?

<FilesMatch "\.jpg$">
    order allow,deny
    deny from all
</FilesMatch>

<FilesMatch "-[0-9]+x[0-9]+\.jpg$">
    order allow,deny
    allow from all
</FilesMatch>

The first part denies access to all .jpg files and the second part searches for files with a size appended to the filename and allows access to those… you could also add directives for any other .jpg files that need to be viewable but all my other graphics are .png files so it’s not a problem for me.

Leave a Comment