Portal Home > Knowledgebase > Advanced > How do I prevent hot/direct linking?


How do I prevent hot/direct linking?




Hotlinking or direct linking is a method that uses another server's bandwidth to display images, and various other files. This effects you negatively, as even though they are linking the image on their site, they're still using your bandwidth to display the file.

One way that you can prevent this is by setting up an .htaccess file for hotlink protection.

Do to this, simply create an .htaccess file in your public_html directory with the following snippet:

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://www.your-domain.com.*$ [NC]
RewriteRule .(gif|jpg|png)$ - [F]

 

Where http://www.yourdomain.com is your domain name. If you want to add other files to prevent from hotlinking, you will need to add the file extension as it looks in the above example.

Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read

Powered by WHMCompleteSolution