The Lotus Cars Community banner

1 - 5 of 5 Posts

·
Registered
Joined
·
2,112 Posts
Discussion Starter #1
I'm trying to restrict hot-linking on my site by adding an .htaccess file, but when I add it, my site goes down and all I get is a page saying, "500 Internal Server Error". Is there anyway to solve this problem? I've tried everything I could think of and nothing is working.
 

·
Registered
Joined
·
2,563 Posts
Here it is.
honestly, I've never had a fantastic grasp on htaccess - at least not enough to debug yours, however, here's mine. It works fine (though I'm only interested in preventing hotlinking of gif & jpg):

Code:
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?mysite\.com/.*$ [NC]
RewriteRule \.(gif|jpg)$ http://mysite.com/createImage.php [R,L]
btw, "createimage.php" could just as easily by "fu.jpg". I just display a little custom message that gets turned into an image - that's what createimage.php does... it's actually an image.
 
1 - 5 of 5 Posts
Top