WordPress.org

Ready to get started?Download WordPress

Forums

ByREV WP-PICShield
[resolved] Using this plugin with CDN (10 posts)

  1. ovidiubica
    Member
    Posted 1 year ago #

    Hello, is your plugin compatible with images hosted on CDN?

    http://wordpress.org/extend/plugins/byrev-wp-picshield-hotlink-defence/

  2. Emilian Robert Vicol
    Member
    Plugin Author

    Posted 1 year ago #

    Hello Ovidiu,

    Is not compatible but can "improvise" something to solve requirement.

    if your CDN send "User Agents" signature in request, this si simple: add that User Agents to "Allowed User Agents" list.

    I will provide a picture generated by script, that print/show details about request: ip, host name, user agent, referrer (is a trap to get information about cdn request)

    But the easiest is to use DNS IP's assigned to CDN in htaccess rule ... I'll also add an option in the next version, today or tomorrow !

  3. ovidiubica
    Member
    Posted 1 year ago #

    I currently use cnames to map my own subdomains to CDN's host if this helps.

  4. Emilian Robert Vicol
    Member
    Plugin Author

    Posted 1 year ago #

    But there is a problem: pictures served by the CDN can not be intercepted by this plugin and watermarked + and can not be redirected to attachment sau post gallery !!!

    is a complicated issue :)

    Unless you have access to the CDN server, can add a script and rules in htaccess !!!

  5. ovidiubica
    Member
    Posted 1 year ago #

    Just spoke with support, they can manually set hotlink protection on CDN side. Not sure about your rewrite rules as they serve content using nginx. Hope they can translate them.

    Also, I use origin pull at the moment.

    It is indeed a complicated issue but the latest Google image search is a joke. My traffic went down 70%.

    I made an effort to play by their rules but this really pissed me off.
    I pay for CDN bandwidth just so they can hotlink my images.
    If this doesn't work one way or another, I'm gonna block their bot.

  6. Emilian Robert Vicol
    Member
    Plugin Author

    Posted 1 year ago #

    hm ... CDN complicated things ... I mean especially redirects

    maybe something like this in CDN htaccess;

    RewriteCond %{REQUEST_URI} \.(jpg|jpeg|png|gif)$ [NC]
    RewriteCond %{HTTP_REFERER} google\.[^?]+[\?&].*q= [NC]
    RewriteCond %{REQUEST_URI} ^(.*)cdn.yourdomain.ext/(.*)$
    RewriteRule (.*) http://yourdomain.ext/byrev-wp-image2url.php?src=http://yourdomain.ext/%1 [L]

    I'll check soon if it works for me ... I have a CDN script that can work, and I'll let you know about results.

    UPDATE: EVRIKA :) I have a solution for watermark, I will return after tests ... 1-2 days.

    RewriteCond %{REQUEST_URI} \.(jpg|jpeg|png|gif)$ [NC]
    {all important rules from plugin}
    RewriteCond %{REQUEST_URI} !_HOTLINK_CACHE_FOLDER [NC]
    RewriteCond %{REQUEST_URI} ^(.*)cdn.yourdomain.ext/(.*)$
    RewriteRule (.*) http://cdn.yourdomain.ext/_HOTLINK_CACHE_FOLDER/%1 [L]

    Not tested !

    -----------------------
    Note: in wordpress htaccess WP-PICShield rules, need something like this:
    RewriteCond %{REMOTE_ADDR} !^IP-CDN-HERE [NC]

  7. Emilian Robert Vicol
    Member
    Plugin Author

    Posted 1 year ago #

    Download Version v1.8.5b

    = 1.8.5b =

    * add allow remote ip list
    * add CDN Tools, Info and Help (warning: this is not for dummies, dont screw your server!)
    * Change design from flat only-one page to multiple-pages.

  8. roro
    Member
    Posted 1 year ago #

    Any help to use this with Cloudflare?

  9. Emilian Robert Vicol
    Member
    Plugin Author

    Posted 1 year ago #

    Ho @roro

    Without control over CDN server is imposible to fight agains hotlinking !

    So, images loaded by google from CDN will not be protected ... except the case when you can add rules in CDN htacces.

  10. bigu_c
    Member
    Posted 7 months ago #

    Hello,

    How to disable CDN tool?

    Thanks.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags