Forum Moderators: phranque
I need some help with my .htaccess file.
To protect my swf files on my server, I placed a .htaccess file to stop hotlinking.
Here is the code off my .htacces file.
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?example1.be [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?example2.nl [NC]
RewriteRule \.(swf¦dcr)$ http://www.example1.be/500.html [NC,R,L] The swf files are hosted on www.example1.be and ww.example2.nl is my second game site. As you see www.example2.nl is allowed to link the swf files, but this code is not working in Firefoxe.
When I wanna play a game with firefox on both websites, I get a message "Stop Hotlinking" and it redirect me to www.minispel.be, but he has to do this only with other websites.
It works perfect with IE and Opera, but not in Firefox.
Can someone help to fix this script for Firefox.
[edited by: jdMorgan at 7:20 pm (utc) on Aug. 22, 2006]
[edit reason]
[1][edit reason] examplified [/edit] [/edit][/1]
If nothing is sent, it fails your test and you get the error.
I would add another RewriteCond to the top of your ruleset
RewriteCond %{HTTP_REFERER}!^$
That should fix the problem by testing for the blank referer as well.
By the way, you will want to edit your post to remove your actual urls as specific URLs are not allowed.
The server encountered an internal error or misconfiguration and was unable to complete your request
I changed the code like this.
RewriteEngine on
RewriteCond %{HTTP_REFERER}!^$
RewriteCond %{HTTP_REFERER}!^http(s)?://(www\.)?siteone.be [NC]
RewriteCond %{HTTP_REFERER}!^http(s)?://(www\.)?site2.nl [NC]
RewriteRule \.(swf¦dcr)$ [siteone...] [NC,R,L]
BTW how can I edit my post?