Administration Apache Security Tips and Tricks

Prevent hot linking of images.

Hot linking is displaying an image on a website by linking to the same image on another website, rather than saving a copy of it on the website on which the image will be shown.

Lets say, you have an image at www.yourdomain.com/image.jpg and it is not well protected. If someone links this image to his website as www.someoneelse.com/image.jpg, then it is going to consume both bandwidth and resources of your server when any end user access www.someoneelse.com/image.jpg.

All traffic of such requests will be coming to your server. It will be just like someone is enjoying a free ride and you are paying for it.

Hot linking of websites can be prevented with following simple .htaccess rule placed in the DocumenRoot folder of your website.

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?yourdomain.com [NC]
RewriteRule \.(jpg|jpeg|png|gif)$ – [NC,F,L]

Please remember to replace “yourdomain.com” with your own domain in the above .htaccess.

Related Articles

  • Scanning for rootkits and possible exploits – RKHunter

    Rootkits are malicious softwares that are installed by intruders to gain access to your server once the security of the server has been breached.  Intruders can leave some malicious softwares...
  • SSH: Whitelist IPs for Your Server

    If you wish to whitelist certain IP’s for your server for any reason, you can easily go into your Webair Ezpanel for this. When whitelisting an IP, please provide the specific...
  • Disk Benchmarking Tools.

    One of the main bottlenecks in server slowness is the Disk IO. If the speed of your disks are slow, then the CPUs of your servers may be wasting their CPU...
  • What is an Account Passphrase?

      Webair offers an extra layer of security to our clients when calling in regarding support called an Account Passphrase. This will be asked when calling into our phone support...