2

I enabled watermark funtion of Magento, but original files still accessable from url without watermark.

Example:

Cached image url with watermark

/pub/media/catalog/product/cache/df484df48ez74849c15sd4f7780/f/f/dsf-8f48d4f.jpg

Original image url without watermark:

/pub/media/catalog/product/f/f/dsf-8f48d4f.jpg

So, if someone remove /cache/df484df48ez74849c15sd4f7780/ from url can access to original photo without watermark to steal images.

How can i protect my original images?

3 Answers 3

1

I would suggest the only way to guarantee the images are permanently watermarked is to edit them before uploading them to your site.

I appreciate this is time consuming thought.

0

very good solution: How To Protect Original Product Images In Magento 2?

The simple solution here is modifying and using the following .htaccess file in the /pub/media/catalog directory:


 Options +FollowSymLinks
RewriteEngine on

#The next coding line permits the original images to be accessed by admin end directly

RewriteCond %{HTTP_REFERER} !^http://www.yourwebsite.com/.*$ [NC]

#The next coding line permits the watermarked images to be accessed directly. It is according to the rule where the URL does not contain a cache.

RewriteCond %{REQUEST_URI} !(/cache/) [NC]

#It is the page where your store visitor will be redirected if they will attempt to access images directly.

RewriteRule \.(gif|jpg)$ http://en.wikipedia.org/wiki/You_shall_not_steal [R,L]
-1

I would recommend setting up Apache/Nginx rules to prevent users from accessing paths inside the /pub/media/catalog/product/ directory, other than /pub/media/catalog/product/cache/…

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.