Forum Moderators: goodroi

Message Too Old, No Replies

How to prevent hotlinking but allow one site using htaccess?

         

hersheyyu

12:20 pm on Sep 15, 2005 (gmt 0)



I place a .htaccess in the directory of multimedia files. Like this:

SetEnvIfNoCase Referer "^http://www\.mysite\.com/" local_ref=1
SetEnvIfNoCase Referer "^http://www\.othersite\.com/" local_ref=1
SetEnvIfNoCase Referer "^http://www.mysite.com/directory" local_ref=

<FilesMatch "\.(wmv¦wma¦swf¦rm¦rmvb¦mp3)">
Order Allow,Deny
Allow from env=local_ref
Allow from 127.0.0.1
Allow from XXX.XXX.XXX.XXX
</FilesMatch>

Where: XXX.XXX.XXX.XXX is the IP of the othersite.
"http://www.mysite.com/directory" is the directory that contain the multimedia files.

But its happened that the result is, the othersite can't link the multimedia files of my site. How should I do or edit the .htaccess to allow the othersite to link my files successfully?

Thank so much!

Dijkgraaf

11:38 pm on Sep 15, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Wrong forum. Try
Apache Web Server forum
[webmasterworld.com...]