1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

Blocking external image Hotlinks

Discussion in 'Plesk for Linux - 8.x and Older' started by motowebmaster, Feb 11, 2006.

  1. motowebmaster

    motowebmaster New Pleskian

    Nov 16, 2004
    Likes Received:
    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?