I want to use my .htaccess file to specifically eliminate myspace.com profiles from hotlinking my files. My code is inside...
I have used the following code (based on
this example):
RewriteEngine On
RewriteCond % ^http://(www\.)?myspace\.net/ [NC,OR]
RewriteCond %{HTTP_REFERER| ^http://(www\.)?myspace\.com/ [NC\
RewriteRule \.(jpe?g|gif|bmp|png|mp3|mov|wmv)$ - [F]
This works a little too well. When I go to my website i receive an "internal server error". When I delete the .htaccess file, I'm back in.
I have also tried this code (based on
this example):
RewriteEngine On
RewriteCond %{HTTP_REFERER} ^http://(cgi¦profiles¦www\.)?myspace\. [NC,OR]
RewriteRule \.(jpe?g|gif|bmp|png|mp3|mov|wmv)$ - [F]
This seems to work okay, but it won't allow these files to be accessed from within my site (say, the front page of my blog). For instance, I see text, but no pictures. When I delete the .htaccess file, everything is back to normal.
Can anybody help me to write a .htaccess file that will prevent hotlinking from www.myspce.com and profile.myspace.com that will allow hotlinking from other locations (especially my own internal site)? I've Googled, searched AskMetafilter archives and followed examples, but nothing is working quite right. I need someone with experience to take a look at what I'm doing here. For what it's worth, my host is doteasy.com and I don't really know what the backend is. I am throwing the .htaccess file in my /var/www/html/ directory. If you need more info please let me know. Thanks in advance for your help.
posted by fvw at 5:37 PM on August 14, 2005