• If the .htaccess has this code…

    RewriteEngine on
    RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?mydomain.com [NC]
    RewriteRule \.(jpg|jpeg|png|gif|mp4|avi|pdf|mp3|mvi)$ https://mydoamin.com/bad_image.jpg [NC,R,L]

    …the images do not display in the PDF but if I add one extra line…

    RewriteEngine on
    RewriteCond %{HTTP_REFERER} !^$
    RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?mydomain.com [NC]
    RewriteRule \.(jpg|jpeg|png|gif|mp4|avi|pdf|mp3|mvi)$ https://mydoamin.com/bad_image.jpg [NC,R,L]

    … it does load. It seems allowing blank referers is required. Although it works for the PDF, it does not keep the integrity of the hotlink protection

  • The topic ‘Hotlink Protection breaks the PDF images’ is closed to new replies.