• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Blocking external image Hotlinks

motowebmaster

New Pleskian
Trying to keep other sites from hotlinking to my site's images.

I've been working with the following in my vhost.conf file. If I remove the # signs on the respective four lines, run the reconfig psaadmin and restart apache, which will restart successfully - but none of my images will appear on my website:

Options +FollowSymlinks
RewriteEngine On
RewriteCond % !^$
RewriteCond % !^http://domainname.net/.*$ [NC]
RewriteCond % !^http://www.domainname.net/.*$ [NC]
RewriteRule \.(gif|jpg|jpeg|png|swf)$ - [F,NC]

Below is what SwSoft's Knowledgebase states to do in vhost.conf:

RewriteEngine on
RewriteCond % !^$
RewriteCond % !^http://(www\.)?MY_DOMAIN\.COM(/)?.*$ [NC]
RewriteRule \.(gif|jpg|jpeg|png|swf)$ - [NC,F]

Which I tried as well, with the same results. Initially I thought that making the lines less complex it would help - but no dice.

Any thoughts?
 
Back
Top