Hotlink protection of images with .htaccess

Use this generator to create a .htaccess file for hotlink protection of your images and pictures. Hotlink protection can save you lots of bandwidth by preventing other sites from displaying your images.

After you have created a .htaccess for hotlink protection, you can use our tool to test hotlink protection.

Allowed Domains

Enter the domains that you will allow to hotlink images. IE your own domain.

One domain per line. No www.

Allow Blank Referers

Some surfers uses a personal firewall or antivirus program, that deletes the page referer information sent by the web browser. Hotlink protection is based on this information. So if you choose not to allow blank referers, you will block these surfers. You will also prevent people from directly accessing an image by typing in the URL in their browser.

It is recommended to allow blank referers.

Blocked Image URL

If you want to show an image for blocked hits, enter the URL below. NOTE: Make sure the image is not hotlink protected or your server can go into an endless loop.

Leave blank to just block the hits causing a red X to appear instead of the image.

Files To Protect

Enter the extension (without the dot) of the images you want to hotlink protect.

Use a space to separate extensions.