|

Web Host Bluehost Hot linking Hot Link Protection
Go
to Bluehost Webhosting Site Now
Bluehost's Web Host Review
Here's the instructions for setting up hotlinking from
Bluehost's
Knowledge Base. Always check their help center knowledge base for
updates on their current procedures and helpful hints.
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.
Code behind the protection (.htaccess) Hotlink
protection
What if you need to protect the /images folder to not
show images when people type in the correct URL like
www.mydomain.com/images/ ?
How to protect your images from prying eyes
Hotlink protection, Password protecting, or chmod could help you, this 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>
Remember if your images don't show up where you want
them to.
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.
|