Skip to main content

Setting up Hotlink Protection in SiteWorx

If you'd like to stop other websites from being able to link directly to files on your site, InterWorx can help you to accomplish that.

ℹ️ This feature creates or modifies an .htaccess file in the location you specify to accomplish this task. This is why we're going to use the htaccess function.

  1. Log into SiteWorx.

  2. In the Hosting Features area, select Htaccess.
    Select Htaccess from the Hosting Features
Section

  3. Now you need to select where you want your hotlink protection to apply. If you want it to apply to your entire domain, select the appropriate directory from the list in the Global Directory Options section and click Edit.
    Click Edit Next to the Global Directory you Want to Activate
Hotlink Protection
In

  4.  In the top section, select the Hotlink Protection button.
    Click the Hotlink Protection
Button

  5. Fill out the following information:
    Fill in the Extensions to Protect, the Domains to Allow, Turn on
the Protection and Click
Update

    • You can turn on or off the Hotlink Protection Status quickly. If you need to temporarily turn off the protection, you can change this setting and anything you've added in the other fields here will remain (making it easier to re-enable later).

    • The Blocked Extensions field lets you specify the file types you want to protect. You should enter one extension per line and you should include the period at the start of the extension (.jpg rather than jpg).

    • You can let certain domains hotlink to your content by specifying the full URL to each one in the Allowed domains field. The parent domain (the one you're in right now) will automatically get added to this field (with and without the www). You should add one per line and include the protocol as well as the domain name.

    • Allow Direct Access will allow the blocked extensions to be loaded so long as their isn't a referred-by field included with the request (i.e., the user is loading the file directly in their browser rather than linking to it from another site). Turn this off to disallow direct file access.

    1. The Replace with field is optional, but you can link to the full URL to a file you want to automatically force hotlinkers to load instead. For example, instead of loading the cute cat picture from your website, they will see a "no cats for you" image file. This field is optional. If you leave it blank then the hotlinker will only get a 403 (forbidden) error instead of the file.

    2. Click Update to apply your changes immediately or Cancel to not make any changes at all and leave everything the way it was before.

⚠️ You should test your hotlink protection after you enable it. Make sure your own site is able to load content while other sites are not.