Infotx

Welcome to Infotx - Webmaster Guides and Resources.

Web hosting using Hot Link Protection.

Hot Link Protection

 

Hot Link Protection Basics

 

Hotlinking is when someone displays your images (or other media) on their website by directly linking to your website. This means that they get to display your files while using your bandwidth. (Theft)

Setup of Hot Link Protection
1. Log into cPanel
2. Go to Hot Link Protection

Fields
URLs to Allow Access- Enter the URLs you want to give access to the restricted files. Make sure you enter these with and without the www's if you want the images to be accessed both ways.
Extensions to allow- Enter the file extensions you want to block access from sites not listed in your, URLs to Allow Access, list.
Url Redirect- If you don't have direct requests enabled, by entering a URL here this will redirect people if they enter the URL of the file directly into the browser.
Allow direct requests- Check this if you want to allow people to be able to access restricted files by entering the path/URL into the browser.

 

 

Protect your /images folder to not show images when people type in the correct URL like www.mydomain.com/images/

 

Protecting images from prying eyes.

Hotlink protect Password protecting, or chmod could help you, but this a directory can be done several ways the way you should protect a directory of files or images. Apache has a built-in method for protecting images with in directories from prying eyes, using the .htaccess file.

When your browser sends a request for an image, it usually also sends the URL of the page that linked to that image. The following .htaccess file causes the server to check this URL ("Referer" in the following snippet) and if it is one of the authorized URLs that you specify, it will set an internal flag called "locally_linked". This internal flag is technically called an "environmental variable". If the URL sent is not in this list of authorized URLs, the flag (or ev) is not set. Note that we also set the "locally_linked" variable if the browser does not send any URL at all: this occurs when the visitor accesses your site using a browser or a proxy that suppresses the referring URL.

The web server then checks if the file requested has an extension in the list given below (gif, png, jpg and jpeg). If so, and the "locally_linked" variable is set, it will send the image. Otherwise it an error will be sent. If this is to complex then you can use the hotlink manager, or the password protect icon in the cpanel.

---------------code-----------------------------------------------------------
SetEnvIfNoCase Referer "^http://www.your-domain-name-here.com/" locally_linked=1
SetEnvIfNoCase Referer "^http://www.your-domain-name-here.com$" locally_linked=1
SetEnvIfNoCase Referer "^http://your-domain-name-here.com/" locally_linked=1
SetEnvIfNoCase Referer "^http://your-domain-name-here.com$" locally_linked=1
SetEnvIfNoCase Referer "^$" locally_linked=1
<FilesMatch ".(gif|png|jpe?g)$">
Order Allow,Deny
Allow from env=locally_linked
</FilesMatch>

 

 

Why don't my images display on my site?

 

If the images are uploaded in the correct location and your code references each image correctly, you have Hot Link Protection enabled. You need to add your domain/subdomain to the, URLs to Allow Access, list found within Hot Link Protection. You should specify both with and without the www's if you want the images to display from both URLs. You do this through the 'Hotlink Protection' section of the control panel.