7. How to prevent image hotlinking for Joomla using cPanel

7. How to prevent image hotlinking for Joomla using cPanel

Hotlink protection prevents other websites from linking to your images and files and thereby stealing your bandwidth

You'll need to be logged in to your cPanel account to enable hotlink protection for your Joomla installation

1) Click Hotlink Protection

cPanel should have automatically filled this box in for you. If that isn't the case, you'll need to type all domains and subdomains that should be able to access your files. Note that www is considered a subdomain and must be included explicitly

2) Add any additional domain names here

3) Now, specify any other file extensions for which to restrict access

Allowing direct requests lets people type the URL to a file in their browsers but not access it on a web page other than one specified

4) Click here to allow direct requests

By default, an error message will be displayed when someone triggers the hotlink protection. An alternative is to redirect the person to a URL specified here

5) Type a redirect URL here

6) Click Submit to activate Hotlink Protection

7) Click Go Back

With that done, hotlink protection is now enabled for all files in your public_html folder and every folder it contains. But what if you just want the Joomla folder to be protected?

8) Click Home

Scroll down

9) Click File Manager

10) Click Show Hidden Files

11) Click Go

12) The hotlink protection is saved in a file called .htaccess in the public_html folder. Right-click on it

13) Go to Copy

14) Now, enter the path to your Joomla directory and click Copy File(s)

Let's verify that the .htaccess file contains the correct information

15) Double-click on the Joomla directory

Scroll down until you see .htaccess

16) Click the checkbox...

17) ...then click Edit

18) Click Edit

This looks correct. Every domain name we entered shows up here...all the file types are here...and the redirect URL is here. If you enabled Direct Linking, this line will be here, too

19) Make any necessary changes, then click Save Changes

Now that Joomla has hotlink protection set up independently from cPanel, let's disable it there

20) Click Disable

That's all there is to it! Hotlink protection is now enabled only for your Joomla directory

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

13. How to back up your Joomla database using cPanel

13. How to back up your Joomla database using cPanel Backups are an essential part of any...

11. How to back up your Joomla database using phpMyAdmin

11. How to back up your Joomla database using phpMyAdmin Backups are an essential part of any...

3. How to change the Joomla directory using cPanel

3. How to change the Joomla directory using cPanel This tutorial assumes you are already...

2. How to change the Joomla directory using FTP

2. How to change the Joomla directory using FTP This tutorial assumes you already have your...

8. How to change the default Joomla favicon

8. How to change the default Joomla favicon A favicon is a small image that shows up next to...