|
Posted by Blinky the Shark on 01/30/07 06:14
Rik wrote:
> 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:
Well, I can't find anything wring with brevity, if it gets the job done.
I'll plug that in and nuke the old stuff. Thanks.
> 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.
Understand. Thanks.
--
Blinky RLU 297263
Killing all posts from Google Groups
The Usenet Improvement Project: http://blinkynet.net/comp/uip5.html
Navigation:
[Reply to this message]
|