Web Development

How to deny external links to images from your Joomla website?

Linking to image files stored in another server is called hot linking. With this practice someone else is using the bandwidth and the storage space of your server by connecting your own images with its own website and this reduces the performance of your server.

If you think that this is happening to your website or you want to avoid it there is a way to do this. All you have to do is add the following code rules in your .htaccess file that will check whether the connection is from an unknown source and replace the desired image with an alternative error image (placeholder). As shown in the code below the .gif and .jpg image files are replaced with another image. 

#stop extrenal connection and give alternative coontent 

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^https://(www.)?*$ [NC]
RewriteRule .*.(gif|jpg)$ [R,NC,L]

Replace the address in place of and the alternative image that will be shown when someone requests an image from your page in place of Also you can add other file types if desired in brackets together with the extensions (gif|jpg|.....).

Otherwise instead of an alternative image you can show an error page, simply replace the RewriteRule line in the above code with the following line:

#show an 403 forbidden error page
RewriteRule .*.(gif|jpg)$ - [F,L]

You can also give permission to another website to use your images. Place the following line of code after the line that contains the address of your page (in the above code replacing address with the website address that you want to allow external access to your images..

#allowed website address connection
RewriteCond %{HTTP_REFERER} !^https://(www.)?*$ [NC]

IPGLOBAL IKE   |  IP.GR Web Hosting and Domain Name registration services in Greece
Cookies Preferences
 Functional  Statistics  Marketing

You can see detailed information about the use of cookies on the page: Terms of use