Prevent hot linking of images from .htaccess or cPanel

Some website users directly link to your website Images and steals the bandwidth of your website. You can avoid hot linking by two ways. From cPanel or via .htaccess file directly.

1. Prevent from cPanel (x2 theme).

Login to cPanel. You will find hotlink protection icon from where you can enable hot link protection.

2. Prevent from .htaccess file.

You can directly place below code in your .htaccess file to disable hot linking:

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www.)?yourdomain.com(/)?.*$ [NC]
RewriteRule .*.(gif|jpg|jpeg|bmp|wmv)$ http://www.yourdomain.com/image.jpg [R,NC]

Note: replace yourdomain.com with your domain name.

Thanks!

Hosting Companies insights

2977 Web Hosting Reviews A trusted source of genuine reviews. Learn Reviews
2355 Web Hosting Companies Ever-growing pool of web hosting providers. Browse Providers
2826 Web Hosting Coupons Exciting web hosting deals available here Browse Coupons
Share
Tweet
Share
Share
Share
Email