Post by issues » Sat Sep 12, 2015 6:40 am

Im looking for a solution to block direct url access to product images.
I have tried what I have found online with htaccess . it "almost" works.
For example. If i go to a product and get the direct image url from the page source i can paste this in the browser and the image will pop up. BUT if i refresh the page, it then actually works and blocks access. But I have to refresh to make it work. ( the thief has already copied the image by now ). So its reading the cached image. So, what I am looking for is a why to pull from a fake url or somehow prevent access top the image folder without preventing the site from being able to read from the folder. I'm selling "art" and need to protect these images any way I can.
Thanks for any advice.

Newbie

Posts

Joined
Wed Aug 05, 2015 8:00 am

Post by straightlight » Sat Sep 12, 2015 6:53 am

With a simple print screen from your keyboard, even multiple images can be captured at the same time without the need to click on a URL image. It wouldn't be quite useful to use an image protection even though different image size might be involved from the page.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Opencart.com Administrator / Quality Assurance Analyst / Programmer


Administrator

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by issues » Sat Sep 12, 2015 7:21 am

straightlight , of course you can use print screen, but that only works if you have the "full" image being shown. If you use a quick view you could print screen 20 times at different zoom areas and piece them together I doubt many people will do that. I have everything covered except the protection of the url.

Newbie

Posts

Joined
Wed Aug 05, 2015 8:00 am

Post by straightlight » Sat Sep 12, 2015 7:55 am

One example you could use would be my adding routines to the store root .htaccess file after the ReWriteEngine On:

Code: Select all

RewriteCond %{HTTP_REFERER} !^http://yourdomain.com/ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.yourdomain.com/ [NC]
RewriteRule [^/]+.(gif|jpg|png|zip|pano|pdf|txt|mpg|mpeg|mov|js)$ http://www.yourdomain.com/bug.gif [R,L]
Of course, you'd need to modify each yourdomain.com and each extension files to your discretion. Although, it would be great to indicate that the default template uses the image popup feature for thumbs and images which could probably be an issue on that end.

Note: It might require apache to be restarted if adding these features.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Opencart.com Administrator / Quality Assurance Analyst / Programmer


Administrator

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by issues » Sat Sep 12, 2015 8:00 am

that is basically what I am using.. these do not work however. If you are on the page with an image. You view page source, you copy image link. You paste image link, you WILL see the image. It will only be blocked if you hit refresh.

my htaccess code

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?mydomain.com [NC]
RewriteRule \.(jpg|jpeg|png|gif)$ http://www.mydomain.com/copyright.jpg [NC,R,L]

Newbie

Posts

Joined
Wed Aug 05, 2015 8:00 am

Post by issues » Sat Sep 12, 2015 8:06 am

im looking for something like this http://michael.theirwinfamily.net/artic ... d-htaccess but for open cart the "Blocking Direct Path Access" section

Newbie

Posts

Joined
Wed Aug 05, 2015 8:00 am

Post by straightlight » Sat Sep 12, 2015 11:40 am

One topic you can follow as this would be the type of question to ask stackoverflow about:

http://stackoverflow.com/questions/3990 ... -to-images

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Opencart.com Administrator / Quality Assurance Analyst / Programmer


Administrator

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by issues » Sat Sep 12, 2015 11:43 am

appreciate it. I think I did see that one. You would think this would be a "Standard" protection for every image online.. crazy it's not.

Newbie

Posts

Joined
Wed Aug 05, 2015 8:00 am
Who is online

Users browsing this forum: No registered users and 46 guests