How to Enable Hotlink Protection in HostGator
Hotlink protection prevents other websites from displaying images and selected media directly from your HostGator account. When hotlinking occurs, another site uses your image URL while your hosting account supplies the bandwidth. The result can be slower pages, higher resource usage and content appearing elsewhere without permission.
HostGator customers can usually enable this safeguard through cPanel, without editing configuration files manually. The setting is useful for Australian business websites, photographers, bloggers and online shops serving visitors from Sydney, Melbourne, Brisbane or regional areas where a limited hosting plan may need to handle every megabyte efficiently.
What Hotlink Protection Does
A protected image normally loads when a visitor opens it on your website, such as example.com.au. If another website embeds the same file using your full image URL, HostGator checks the referring domain before serving it. Requests from approved domains continue to work, while unapproved requests can be blocked or redirected.
This feature generally applies to file extensions such as JPG, JPEG, PNG, GIF, SVG and sometimes WebP. It does not stop somebody from downloading an image and uploading a separate copy to another server. It also does not replace copyright notices, watermarks, access controls or a wider content security strategy.
Hotlink protection is especially relevant when a page becomes popular on social media or appears in search results. A local wedding photographer, for example, may discover that images hosted for a Melbourne portfolio are being embedded on unrelated pages. A small online shop selling products across Australia may also want to prevent catalogue images from consuming hosting resources on comparison or scraping sites.
The setting is less important for websites that use a dedicated image CDN, private media storage or mostly text-based pages. A CDN may already manage delivery and caching, although its origin configuration still needs to be reviewed before blocking external requests.
Check Your Files Before Enabling It
Make a list of the domains that should be allowed to display your files. Include the main domain, the www version and any other domain connected to the account. If the site uses a staging address, subdomain, landing-page builder or separate store, add those addresses where appropriate.
You should also confirm which extensions need protection. Protecting common image formats is a sensible starting point. Adding CSS, JavaScript, PDF or video extensions can cause unexpected problems if external services, email campaigns or embedded documents rely on those files. Only include formats that you genuinely want to restrict.
Before changing the setting, save a current copy of important configuration files and note your existing redirects. Check that your image URLs use the correct HTTPS address. A site that has moved from HTTP to HTTPS may appear to have broken images when the real issue is an incomplete allowlist.
Useful checks to complete first include:
- Confirm the canonical domain and every active subdomain
- Identify image and media extensions used by the site
- Record CDN, payment and marketing services that load assets
- Keep a backup of the current
.htaccessfile
Australian businesses should also consider external services used in the local market. A booking widget, real-estate feed or Australian email platform may request assets from a separate domain. If your site uses a .com.au address alongside a .au redirect, both versions may need attention even when visitors mostly use one.
Enable the Setting Through HostGator cPanel
Sign in to the HostGator customer portal, open the relevant hosting account and launch cPanel. Depending on the account interface, the cPanel link may appear under hosting management rather than on the main billing screen. If you manage several packages, check the account name before opening the control panel.
In cPanel, find the Hotlink Protection tool, usually located in the Security area. The screen normally contains a button to enable protection, a field for trusted URLs or domains, a list of file extensions and an option to redirect blocked requests. The exact labels can differ slightly between cPanel versions and HostGator account types.
Add the full versions of your approved website addresses where the interface allows it. For example, you might need both https://example.com.au and https://www.example.com.au. Include a subdomain such as shop.example.com.au if the shop loads images from the same hosting account. Avoid adding broad domains that you do not control.
Enter the extensions you want to protect, separated according to the format shown by cPanel. Common choices include jpg, jpeg, png, gif, svg and webp. If the tool offers an option to allow direct requests, consider leaving it enabled for testing; visitors who open an image URL directly may otherwise see a blocked response.
You may choose to redirect blocked requests to a small replacement image or another page. Keep that destination on your own domain and make sure it does not use a protected file that creates a redirect loop. A simple branded image can explain that the media is unavailable for external embedding, while a blank response uses fewer resources.
Select the button to activate the rule, then wait briefly for the change to apply. cPanel typically writes the configuration to the account’s .htaccess file. Do not add a second, conflicting hotlink rule immediately afterwards unless you understand how both sets of directives will interact.
Test the Rule Without Breaking the Site
Testing should cover both an approved request and a blocked request. Open several image pages in a private browser window, view the site on a mobile connection and check a page that uses responsive image formats. If your business operates across Perth, Adelaide and the eastern states, remember that visitors may reach cached versions at different times.
For a blocked-request test, place a test image URL in a separate HTML file hosted on another domain or use a temporary local test page. The request should be denied or redirected according to your chosen setting. Remove the test page afterwards so it does not become a public source of confusion.
Review pages that rely on image-heavy features. Product galleries, WordPress themes, CSS background images, feeds and social sharing previews can behave differently. A page may look correct for you because of browser cache while a new visitor receives a broken asset. Test in a private window or clear the relevant cache before deciding that everything works.
If a legitimate service stops displaying an image, add its domain only when you recognise and trust it. Some tools use a proxy or image optimisation service, so the request may come from a provider’s hostname instead of your own. Consult that service’s documentation rather than allowing an entire unrelated domain.
For practical testing, a small content site can use a harmless external page that embeds a sample image. A project presenting no-registration examples could use a generic, non-sensitive test graphic to confirm that an unauthorised referrer receives the intended response. Keep the test focused on delivery behaviour, not on exposing real customer or commercial assets.
Troubleshoot Common Hotlink Problems
A broken image after activation usually means an approved referrer was omitted, a URL format is inconsistent or the protected extension list is too broad. Check the browser’s developer tools for the response status and compare the failing request with a working one. A 403 response often points to the hotlink rule, while a 404 generally indicates a path or filename problem.
Caching can make diagnosis slower. Clear the website cache, CDN cache and browser cache before retesting. If HostGator uses a server-side caching layer for your account, allow time for the old response to expire. Do not repeatedly change several settings at once, because that makes it difficult to identify the cause.
Common fixes include:
- Add both non-www and
wwwdomain versions - Allow HTTPS versions of trusted domains
- Remove CSS, JavaScript or video extensions temporarily
- Check for conflicting
.htaccessrewrite rules
A WordPress installation may also have security or optimisation plugins that write their own hotlink directives. Compare the generated rules and avoid enabling duplicate features in cPanel and a plugin unless the plugin clearly supports that arrangement. A developer can inspect the .htaccess file if the site begins returning widespread 403 or 500 errors.
If the issue affects only social previews, remember that platforms may cache an old image response. Refresh the platform’s preview cache after confirming that the image is available to approved crawlers. Blocking every unfamiliar user agent is a separate measure and should not be used as a substitute for carefully managing trusted domains.
If your business publishes downloadable guides, course material or promotional PDFs, test those files separately. A page for a carry course landing page might load a logo, cover image and downloadable document from different paths. Protect only the assets that require it, and verify that public materials remain accessible to intended visitors.
Maintain Protection As Your Site Changes
Hotlink protection is a maintenance setting rather than a one-time switch. Review the allowlist when you add a new subdomain, migrate to a new CMS, connect a marketing platform or move images to a CDN. Keep a short record of the domains and extensions you approved so another administrator can understand the configuration later.
Monitor bandwidth and error reports in HostGator after enabling the rule. A sudden reduction in image requests may be expected, but a rise in failed requests from your own pages signals a configuration issue. Compare analytics with server logs where available, especially after a campaign, product launch or major news mention sends additional visitors to the site.
For Australian websites, review the arrangement after changing providers or targeting a new market. A .com.au business may add a .au domain, a New Zealand storefront or a regional campaign landing page. Each new host can affect referrers, redirects and cached media. If you work with a freelance developer in a different time zone, document the current cPanel settings before handing over access.
Hotlink protection should sit alongside sensible image compression, descriptive copyright information, backups and a CDN strategy where appropriate. It cannot prevent copying, and an overly strict rule can harm search previews or partner integrations. The best configuration blocks unauthorised embedding while keeping normal visitors, trusted services and your own domains working reliably.
After activation, open cPanel’s Hotlink Protection page, confirm the trusted domain list and test one approved image and one blocked image from separate browsing sessions.