You are here: Re: No Images - Found Something! (was Re: No Images) « HTML « IT news, forums, messages
Re: No Images - Found Something! (was Re: No Images)

Posted by Blinky the Shark on 01/29/07 19:46

Rik wrote:
> Blinky the Shark <no.spam@box.invalid> wrote:
>>>> Is there any chance that's something that, say, cPanel might do if one
>>>> were to enable hot-link blocking? Like perhaps it would only apply to
>>>> image requests that didn't come from within the site?
>>>>
>>>> I seem to have an .htaccess in my images directory, as well.
>>>>
>>> There probably was a preceding line with a RewriteCond statement that
>>> test if the host is your domain name.
>>>
>>> # IF referring is not "mydomain.com"
>>> RewriteCond %{HTTP_REFERER} !^http://(www\.)?mydomain.com/.*$ [NC]
>>>
>>> Since you have an new domain your are testing you need to allow it... or
>>> remove the rule entirely...
>>
>> Here's that part of my .htaccecss (the one in my document root:
>>
>> 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?

And I was getting images blocked because I was accessing that
not-live-yet site by IP/~username, right?

> Well, the .htaccess in the root will also process all requests for the
> images directory.

Unless overridden by another .htaccess *in* the images directory, right?
(And that one would cover all subdirs under it, right?)

> This is indeed clearly a rule to prevent hot-linking, allthough it could
> be very shorter:
>
> 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?

>> 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?"




--
Blinky RLU 297263
Killing all posts from Google Groups
The Usenet Improvement Project: http://blinkynet.net/comp/uip5.html

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация