• Ok I installed your script and it blew out every image on my own site.

    I looked at the .htaccess file and this is what I see:

    # BEGIN HotLinkProtection
    RewriteEngine on
    RewriteCond %{HTTP_REFERER} !^$
    RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?https://MYSUB.MYSITE.com [NC]
    RewriteRule \.(jpg|jpeg|png|gif)$ - [NC,F,L]
    # END HotLinkProtection

    It does not account for WordPress’s automatic “https://” entry to your domain in the general part of the settings and it does not account for the possibility that the site might be on a sub domain (something other than www).

    I can fix it and I may add my fix here later, but not everyone knows how to write PHP.

    Now another easy, and some what important option, would be an image replacement. The example of this would be:

    RewriteEngine on
    RewriteCond %{HTTP_REFERER}!^$
    RewriteCond %{HTTP_REFERER}!^https://(www.)?yoursite.com [NC]
    RewriteRule .(gif|jpe?g)$ /images/hotlink.$1 [L]

    Should be simple enough to add to your script.

    And on more option… although this may be a little more difficult…

    The ability to allow one shared DIR that can be hotlinked to.

    we would need to be able to set the directory and then another .htaccess file would have to be added to that DIR that has the following in it.

    RewriteEngine on

    So this is my input, were do we go from here?

    -Sean

    https://www.ads-software.com/extend/plugins/wordpress-automatic-image-hotlink-protection/

Viewing 1 replies (of 1 total)
  • Hi Sean,

    If you’d like to post your alterations here, I would be happy to add the new code to the next version and course credit you with the changes. I really appreciate you pointing out these limitations and completely agree.

    It’s often funny, I’ve been running this code successfully on over a dozen client websites for the past few months and never encountered problems. It just goes to show how many variables have to be taken into consideration whenever you publish a plugin such as this.

    Thanks again for pointing these out, I look forward to adding some improvements to the code right away!

    Chris

Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: WordPress Automatic Image Hotlink Protection] Sub domain problem and a request for a replac’ is closed to new replies.