| .htaccess redirect not working for me.
|
georgeek

msg:4165709 | 11:22 am on Jul 7, 2010 (gmt 0) | I have Rewrite rules in my .htaccess that work, for example www to non-www and one Rewrite rule that doesn't work:
RewriteEngine on RewriteCond %{HTTP_REFERER} ^http://(.+\.)?blogspot\.com/ [NC,OR] RewriteCond %{HTTP_REFERER} ^http://(.+\.)?myspace\.com/.*$ [NC,OR] RewriteCond %{HTTP_REFERER} ^http://(.+\.)?coldlink\.com/.*$ [NC,OR] RewriteCond %{HTTP_REFERER} ^http://(.+\.)?habrahabr\.ru/.*$ [NC,OR] RewriteCond %{HTTP_REFERER} ^http://(.+\.)?facebook\.com/.*$ [NC] RewriteCond %{HTTP_REFERER} !^$ RewriteRule \.(jpg|jpeg|png|gif|bmp)$ http://mydomain.com/images/hotlinked.gif [NC,R,L] When I put this into my .htaccess the hotlinking images are no longer displayed on the infringing sites but the intended substitute hotlinked.gif is not displayed either. Any suggestions as to why this may be?
|
georgeek

msg:4165776 | 1:36 pm on Jul 7, 2010 (gmt 0) | Ah! Solved it! hotlinked.gif was causing some kind of loop because it is a .gif I changed the name of the file to hotlinked.giff on the server and in .htaccess, now it works as it should.
|
g1smd

msg:4165837 | 3:11 pm on Jul 7, 2010 (gmt 0) | The better way is to exclude that file by adding another RewriteCond (with a negative match for the filname), otherwise you're serving a GIFF file to a browser, and it might not know what to do with it.
|
georgeek

msg:4166342 | 6:38 am on Jul 8, 2010 (gmt 0) | Thanks g1smd that sounds like a good idea but composing RewriteCond's is out of my league, can you point me in the right direction please? I have a followup... One of the sites that is hotlinking is on Google sites [sites.google.com...] Would this work?
RewriteCond %{HTTP_REFERER} ^http://(.+\.)?sites.google\.com/.*$ [NC,OR] I am really worried about including all Google by mistake!
|
|
|