|
Posted by Rik on 01/29/07 20:00
Blinky the Shark <no.spam@box.invalid> wrote:
>>> RewriteEngine on
>>> RewriteCond %{HTTP_REFERER} !^$
>>> RewriteCond %{HTTP_REFERER} !^http://blinkynet.net/.*$ [NC]
>>> RewriteCond %{HTTP_REFERER} !^http://blinkynet.net$ [NC]
>>> RewriteCond %{HTTP_REFERER} !^http://www.blinkynet.net/.*$ [NC]
>>> RewriteCond %{HTTP_REFERER} !^http://www.blinkynet.net$ [NC]
>>> #RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ - [F,NC]
>>> Looks sensible?
>>
>> RewriteCond %{HTTP_REFERER} !^$
>> RewriteCond %{HTTP_REFERER} !^http://(www\.)?blinkynet.net(/|$) [NC]
>> RewriteRule \.(jpg|jpeg|gif|png|bmp)$ - [F]
>
> That to be used instead of the lines I pasted?
Yup, does exactly the same, only shorter. One could even take the empty
referer in the same statement:
RewriteCond %{HTTP_REFERER} !^(http://(www\.)?blinkynet.net(/|$)|$) [NC]
RewriteRule \.(jpe?g|gif|png|bmp)$ - [F]
Tends to get a bit unreadable though :-)
>>> There's none of that in the .htaccess that's in my images subdirectory,
>>> and since there are lines like AddHandler and DefaultCharset in that
>>> one
>>> I sense it's a file that simply got mis-saved to the wrong place.
>>
>> There's no way for us to tell how it got there, and what it's purpose
>> was
>> :P
>
> Well, no shit. :) My question meant, "Are there any reasons that a
> separate .htaccess in an images directory might be useful?"
..htaccess files slow apache down. It makes sense to place an .htaccess
only in the directory where it's applicable, and not in the root, so other
requests won't have to deal with it.
On the other hand checking a lot of different .htaccess files might slow
it down too. I'm not sure when this becomes a factor.
--
Rik Wasmus
Navigation:
[Reply to this message]
|