smaller reset larger         

Main Menu

All times are in GMT -7 (DST) :: The time is now 5:03 am.

Sub Menu

Article Data
Article Ref
Date Created
Mon, 10th Mar 2003
Date Modified
Wed, 4th Jun 2014

   Prevent Hotlinking of Files


How do I prevent others from directly linking to, or "hotlinking" files and other resources present on my site?


It is sometimes useful to prevent others from linking directly to pages or files contained within your site. You may, for example, want users to enter through your index page to see important announcements.
To enable this restriction, create an .htaccess file with the following contents in the directory you wish to protect:

AuthUserFile /dev/null
AuthGroupFile /dev/null
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^
RewriteCond %{HTTP_REFERER} !^
RewriteCond %{HTTP_REFERER} !^
RewriteRule /* [R,L]

...where is your domain name, and is another site you wish to except from the linking restriction. (You may duplicate this line to add other sites.)

Article Comments 

There are currently no comments.