Forum Moderators: phranque

Message Too Old, No Replies

Blocking direct access to files

Got it to work with images and audio files, but not for flash or video

         

LABachlr

6:30 am on Mar 3, 2003 (gmt 0)

10+ Year Member



I got the following .htaccess file from this post [webmasterworld.com] that was made in '01. Since it was such an old post, I could not reply to it.

Here are the contents of the .htaccess file that allowed me to block access to my images and my audio files:

AuthUserFile /dev/null
AuthGroupFile /dev/null
RewriteEngine On
RewriteCond %{HTTP_REFERER}!^http://www.your_domain.com/
RewriteCond %{HTTP_REFERER}!^http://your_domain.com/
RewriteCond %{HTTP_REFERER}!^http://your_ip_address/
RewriteRule /* [your_domain.com...] [R,L]

Does anyone know how to block direct access to flash files and video files (mainly .wmv files) via an .htaccess file?

hakre

4:53 pm on Mar 3, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



hi LABachlr,

your .htaccess-code will redirect any request to your site on anykind of file to your homepage if the visitor came from 'outside'. so this will do the job like you need it.

anyway if it's not working for you, there is a thread about blocking images [webmasterworld.com] with a sample .htaccess file at the bottom. even it's about images only, you can easily extend it for other file-types. additionally it shows how to display a 'do not hotlink' picture instead of the file. if you use a .jpg for this, windows media player will show it (since v6.4). so .wmv hotlinking will lead to this picture.

jdMorgan

6:12 pm on Mar 3, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



LABachlr,

Using the site search link at the top of this page with a search query of "hot-linking" turns up a ton of threads on this subject.

HTH,
Jim

LABachlr

9:18 am on Mar 4, 2003 (gmt 0)

10+ Year Member



OK. Thanks. I'll let you know what works.