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 (.*) https://yourdomain.ext/byrev-wp-image2url.php?src=https://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 (.*) https://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]