I enabled image hotlink protection and now people can't see images on my site. Print

  • 8

Enabling hotlink protection is meant to stop other web sites from making calls to your local image files. This is done by clicking the 'activate' field to see what URL the person accessing the image file came from.

If it doesn't match a site listed in the hotlink protection area of the control panel, it will refuse to load the images for them. Some problems exist if the checks aren't accurate or if the domain isn't on the list.

If you add a new sub domain or domain pointer, or park a domain, you will need to make sure that the new domain or sub domain is on the list of allowed sites/URL's to load images.

The hotlink protection rules are located in a file called '.htaccess' in your master public_html web root directory. Any sub domains, domain pointers or parked domains are all subject to the rules set in this file, since the sub root's you may have for a pointed domain or sub domain also use the same web root path.

That means if you have a master domain of larry.com, then larry.com's web root is /home/larry/public_html. That is where the .htaccess file exists. If you add a pointed domain of bob.com, then bob.com's web root will be /home/larry/public_html/bob. Since bob's web root is in the public_html path, it must follow the rules that are in the .htaccess file in that path.

This is why you must add any new domains to the hotlink protection, if you add them to your site. Otherwise the rules will not be valid and images may not load.

Another problem can exist where some browsers like Internet Explorer do not properly resolve URL's. So, while two browsers are accessing the http://www.larry.com URL, one will resolve it to http://www.larry.com/ and another will resolve it to http://www.larry.com (notice that one has the trailing forward slash / on the URL).

When hotlink protection is enabled, it will set the rule to check the URL as http://www.domain.com/*any URL* (*any URL is only an example showing that as long as it has http://www.domain.com/ at the start of the path, anything else is acceptable and allowed*). So, if it doesn't resolve with the trailing forward slash, larry.com will not be the same as larry.com/ and the image may refuse to load.

To remedy that problem, you can edit the .htaccess file on your main web root (public_html) and simply remove the trailing slash from the rule. Be careful making any changes to the .htaccess file, as some sites use Frontpage server extensions and any changes may affect that. Additionally, an error in the syntax or a typo could make any web site accesses to your domain result in an error, or not allow you to load images until it's fixed.

Was this answer helpful?

« Back