Tom Kagan wrote:The RewriteRule in the above examples can be changed to the following to handle more cases where you do not want hotlinking (Of course, you still need the RewriteCond directives applicable to your site):
RewriteRule .*\.(css|gif|jpg|ico|png|GIF|JPG|jpe|jpeg).*$ - [G,L]
The most important addition in the above change is the .* after the file extension list. This prevents defeating hotlink blocking if the bandwidth pirate adds extra characters to the end of the name (e.g.: http://host.com/mypic.jpg?hotlinkbuster) This change does introduce a limitation, however: You can no longer have a subdirectory named with the same blocked extension (e.g: /adir.icostuff/thefile.html will be blocked).
What f you instead use:
RewriteRule .*\.(css|gif|jpg|ico|png|GIF|JPG|jpe|jpeg)\?.*$ - [G,L]
Shouldn't that allow /adir.icostuff/thefile.html but block http://host.com/mypic.jpg?hotlinkbuster
??