Select Language:
If you want to prevent other websites from stealing your images, you can set up hotlink protection by editing your .htaccess file. This file is usually located in your website’s root folder, such as /public_html or /www.
Start by opening your .htaccess file. If you don’t see it, you might need to enable hidden files or ask your hosting provider for help. Once you locate and open it, add the following code at the end:
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^https://(www\.)?yourdomain\.com [NC]
RewriteRule \.(jpg|jpeg|png|gif)$ – [F,NC,L]
Make sure to replace “yourdomain.com” with your actual website name. This code does a few things:
– It blocks other websites from linking directly to your images.
– If someone tries to include your images on their site, they’ll see a 403 Forbidden error.
– It still allows your site and search engines to display your images normally.
If you don’t have access to the .htaccess file or aren’t comfortable editing it directly, here’s what you can do:
1. Check your hosting control panel—sometimes there’s a security or settings area with built-in options for hotlink protection.
2. Use a plugin like Yoast SEO or WP File Manager if you’re using WordPress. These plugins can help you edit your .htaccess file safely.
3. If the file is locked or you’re unable to edit it, contact your hosting provider. Ask them to enable hotlink protection for your website or help you access the file.
Setting this up is a simple way to protect your images and keep them safe from unauthorized use.