MyAdviseNow
  • Home
    • Home – MAN
  • How To
  • toutorial
  • Android
  • best
  • Windows
  • IOS
  • top 10
  • Tech
No Result
View All Result
  • How To
  • toutorial
  • IOS
  • top 10
  • Tech
  • Windows
  • best
  • Android
  • Smartphone
No Result
View All Result
MyAdviseNow
No Result
View All Result
Home Guide

Hotlinking protection with easy and working methods

Ammar by Ammar
November 13, 2020
in Guide, How To
Reading Time: 5 mins read
0
what is hotlinknig?

how to avoid hotlinking

0
SHARES
87
VIEWS
Share on FacebookShare on Twitter

Why your website is suspended by your hoster? Why your bandwidth can’t take you to the end of the month? You don’t have many hits or visits on your site, but your RAM and CPU are full! You must upgrade your plan! Yes, you must upgrade your hosting plan (This is the exact email you get from your hosting company) and you don’t know why it happens to your resources.

This upgrades are not for free and you must pay for them!

Related Articles

8 Ways to Make Money While You Sleep

8 ways to earn money while you are asleep | 2021 Update

February 21, 2021
what should be on the homepage of a website

5 Home-page Design Tips Everyone should know

February 17, 2021
guest posts on your website

Why should you have guest posts on your website?

February 16, 2021
SEO strategy for skyscraper content

SEO strategy for long-form content: 10+1 key points (Skyscraper content) | 2021

February 14, 2021

let’s consider you have upgraded your resources. This solution is not for the long term, CPU and RAM are overloaded and your package is suspended by the company. So, what is the real solution? Our answer is to avoid Hotlinking. stay with MAN (MyAdviseNow) and solve this problem together.

What is Hotlinking?

Hotlinking is known as the act of stealing someone’s bandwidth by linking directly to their website’s assets, such as images or videos. For example, let’s say the owner of website A is hosting a particular image on their server. The owner of website B sees that image and decides he wants it featured on his website as well. However, instead of downloading the image and hosting it on his own server, the owner of website B links directly to website A’s domain. Therefore, instead of linking to the image via their own domain such as:

  • https://websiteB.com/path/to/image.jpg

They would be instead using website A’s domain:

  • https://websiteA.com/path/to/image.jpg

Hotlinking someone’s website assets can vastly increase their hosting costs. Credit goes to KeyCDN.

How to Avoid Hotlinking in CPanel?

Hotlink protection is a security feature in cPanel designed to reduce bandwidth consumption. It works by preventing third-party websites from directly linking to your content (for example, pulling in images hosted on your server for display on their own web pages).

You can whitelist specific URLs for permitted access to files, nominate specific file types to protect or redirect requests to a specific URL of your choosing.

To set up Hotlink protection in cPanel, head to Security < Hotlink Protection. Credit goes to: Hostpapa

cPanel
Hotlink Protection option is available in CPanel.

How to Avoid Hotlinking by editing Htaccess?

By entering the lines below into an .htaccess file, you can prevent hotlinking to your website:

RewriteEngine On
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?example.com/.*$ [NC] 
RewriteRule \.(gif|jpg)$ http://www.example.com/hotlink.gif [R,L]

In the example above, change ‘example.com’ to your website URL. This causes any hot-linked image to fail to load. You can change the last line to point to any image you like. This image should explain that hotlinking is disabled on your server.

The examples below use http. If you have added an SSL certificate to your site, make sure you adjust the code to use https instead.

DreamHost

Here is another example:

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

You can change the last line to point to any image you like. This image should explain that hot linking is disabled on your server.

Blocking specific domains using htaccess hotlinking protection

The following code fails to load a hotlinked file, but no error is thrown. So, if the site example.com contains a hotlinked image to your site, it would fail to load on their site:

RewriteEngine On
RewriteCond %{HTTP_REFERER} ^http://(www\.)?example\.com(/.*)*$ [NC,OR]
RewriteRule \.(jpeg|JPEG|jpe|JPE|jpg|JPG|gif|GIF|png|PNG|mng|MNG)$ - [F]

To protect other resources, such as video and audio files, add additional extensions to the RewriteRule parentheses block.

Allowing only specific domains for hotlinking using htaccess:

The following code only allows specific sites to load content. For example, the site example.com has all of the content. The following code allows only example.com and dreamhost.com to load the content. All other sites attempting to request any resource fail to load the resource, but no errors are thrown:

RewriteEngine On
RewriteCond %{HTTP_REFERER} !^http://(www\.)?dreamhost\.com(/.*)*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(www\.)?example\.com(/.*)*$ [NC]
RewriteCond %{HTTP_REFERER} !^$
RewriteRule \.(jpeg|gif|png)$ - [F]

In addition, since a user agent may not always specify an HTTP_REFERER value, the RewriteCond %{HTTP_REFERER} !^$ line allows the request to go through if the HTTP_REFERER value consists of a blank string.

Credit goes to: How do I prevent image hotlinking? DreamHost.

How to avoid hotlinking using a plugin for WordPress?

Configurable Hotlink Protection: blocks links to videos, images, audio files from a third party server. You do have the option to whitelist certain sites.

Configurable Hotlink Protection

P.S.ifyou are a WordPress user, you can easily use the plugin and you don’t need many things to do. Using htaccess to forbid hotlink is also easy. Please remember to take a backup of your htaccess file. If something went wrong, you will be able to restore your site.

Tags: hotlinking ban through htaccesshotlinking wordpress pluginhow to avoid hotlinkinghow to protect against hotlinkingwhat is hotlinking
ShareTweetSharePinShareShareSendShareSend
Previous Post

The best free online YouTube Cutter and converter

Next Post

MP3 Tag Editor- edit file metadata – Download Free

Ammar

Ammar

Related Posts

8 Ways to Make Money While You Sleep

8 ways to earn money while you are asleep | 2021 Update

by Ammar
February 21, 2021
1

Does your money increase when you are asleep? Wouldn't that be great if that was true? Since we are still...

what should be on the homepage of a website

5 Home-page Design Tips Everyone should know

by Ammar
February 17, 2021
1

Designing your front page ( Home-Page ) is very important, as it is one of the most important steps in...

guest posts on your website

Why should you have guest posts on your website?

by Ammar
February 16, 2021
0

An important part of site management goes back to updating your audience information with new and fresh content. All webmasters...

SEO strategy for skyscraper content

SEO strategy for long-form content: 10+1 key points (Skyscraper content) | 2021

by Ammar
February 14, 2021
0

Is generating long-form content (Skyscraper content) a part of your SEO strategy? Ever written a piece of content or a long...

increase website traffic

Increase website traffic organically: 25 Ways (2021)

by Ammar
February 12, 2021
0

Attracting more traffic ( increase website traffic ) to the site is one of the main tasks of the site...

Load More

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Plugin Install : Widget Tab Post needs JNews - View Counter to be installed
  • Trending
  • Comments
  • Latest
how to create a YouTube channel

The best free online YouTube Cutter and converter

December 7, 2020
Ad-Networks with INSTANT APPROVAL

Ad-Networks with INSTANT APPROVAL

December 18, 2020
Download Videos From Youtube

How to Download Videos From Youtube

October 6, 2019
make money from home

Make Money From Home And Online

July 29, 2019
Ad-Networks with INSTANT APPROVAL

Ad-Networks with INSTANT APPROVAL

6
Create a youtube channel

How to Create a youtube channel

4

3 Digital Marketing Gurus, You Should Follow Religiously

2
Best laptop for programming in 2019

Best laptop for programming in 2019

1
8 Ways to Make Money While You Sleep

8 ways to earn money while you are asleep | 2021 Update

February 21, 2021
what should be on the homepage of a website

5 Home-page Design Tips Everyone should know

February 17, 2021
guest posts on your website

Why should you have guest posts on your website?

February 16, 2021
SEO strategy for skyscraper content

SEO strategy for long-form content: 10+1 key points (Skyscraper content) | 2021

February 14, 2021
  • About
  • Privacy Policy
  • Contact Us
  • Join our YouTube channel

© 2019 MyAdviseNow MyAdviseNow .

No Result
View All Result
  • About Us
  • Contact Us
  • Health
  • Home
  • Privacy Policy

© 2019 MyAdviseNow MyAdviseNow .