jdMorgan

msg:3820663 | 2:03 am on Jan 7, 2009 (gmt 0) |
The answer depends on whether the link to the "developer image" in the code refers to an image on your own site, or on theirs. If it refers to their site, then you can't use mod_rewrite to fix this, although if you're on Apache 2.x, you might be able to set up an 'output filter' to catch the page content as it's being sent out from your server, and change it there. Otherwise, the code will be identical to the anti-hotlinking code you can find here, except that you should remove the RewriteCond that checks the referrer, as it won't be needed. Jim
|
calvinmicklefinger

msg:3820666 | 2:18 am on Jan 7, 2009 (gmt 0) |
They send the images to my server when doing their auto-update, so then I presume I need only to use the anti-hotlinking code without the REFERRER section. Thanks again. BTW - where is the anti-hotlinking code you mentioned? Do I just search for it, or was there supposed to be a link in your reply? Cheers.
|
calvinmicklefinger

msg:3820668 | 2:23 am on Jan 7, 2009 (gmt 0) |
Would this be it? RewriteCond [mydomain...] [mydomain...] [L]
|
Caterham

msg:3820915 | 11:33 am on Jan 7, 2009 (gmt 0) |
No, you're matching against a local filepath in in per-directory context. That is r->filename (full physical path like /var/www/foo) with the striped directory prefix (if in /var/www/.htaccess, result is foo). RewriteRule ^their\.gif$ my.gif [L]
|
calvinmicklefinger

msg:3820985 | 1:13 pm on Jan 7, 2009 (gmt 0) |
Huh?
|
jdMorgan

msg:3821078 | 3:01 pm on Jan 7, 2009 (gmt 0) |
Well-explained in the Apache mod_rewrite documentation. Highly-recommended. Jim
|
calvinmicklefinger

msg:3821116 | 3:33 pm on Jan 7, 2009 (gmt 0) |
Thanks Jim.
|
calvinmicklefinger

msg:3821128 | 3:51 pm on Jan 7, 2009 (gmt 0) |
I didn't understand that. It was WAY over my head. But, using your advice as the search term, I did find an explanation at [yourhtmlsource.com...] which allowed me to understand the response from Caterham. Thanks to both. Sorry for being so thick. I think whatever search term I was using in Google was giving me too many results and muddying the waters. Cheers to both.
|
g1smd

msg:3821323 | 7:45 pm on Jan 7, 2009 (gmt 0) |
Post your example code to be sure you have the right version. :-)
|
calvinmicklefinger

msg:3821345 | 8:01 pm on Jan 7, 2009 (gmt 0) |
So happy! It's working on the server. Only question is, do I need the backslash before the dash in the second image filename? REwriteEngine On RewriteRule ^theirimage\.gif$ myimage.gif [L] RewriteRule ^theirheader\-repeat\.gif$ myheader-repeat.gif [L] Cheers
|
jdMorgan

msg:3821370 | 8:32 pm on Jan 7, 2009 (gmt 0) |
You don't need to escape either hyphen in that line. Only the regular expressions anchors, character-tokens, operators, and quantifiers need to be escaped with a backslash. See the regex tutorial cited in our Charter. Also, suggest you fix the casing of "RewriteEngine on", although it will work as-is on *almost* all servers. Jim
|
calvinmicklefinger

msg:3821386 | 9:02 pm on Jan 7, 2009 (gmt 0) |
Oops. Hadn't even noticed the E. It's working, but will fix. Where do I find the Charter? Thanks, Kirk
|
g1smd

msg:3821428 | 9:59 pm on Jan 7, 2009 (gmt 0) |
Thanks for posting it. Even code that "works" isn't always "right". :-)
|
|