Jump to content
php.lv forumi

Kas ielādē manu bildi?


Recommended Posts

Protams ka ir reaali, bet tur peec idejas jeedziigaak to buutu dariit (ja vajadziigs visaam bildeem) ar apache iespeejaam nevis teiksim statiskas bildes peeksnji ar php un GD vadiit uz ekraana.

 

Tas gan der tikai ja ir iespeeja tiktl klaat pie apache configa vai arii ir tiesiibas ietot .htaccess

 

t.i. ja refereris ir cita lapa tad raadam kaut kaadu defaulto gljukbildi.. :)

 

Blocked Inline-Images

Description:

Assume we have under http://www.quux-corp.de/~quux/ some pages with inlined GIF graphics. These graphics are nice, so others directly incorporate them via hyperlinks to their pages. We don't like this practice because it adds useless traffic to our server.

 

Solution:

While we cannot 100% protect the images from inclusion, we can at least restrict the cases where the browser sends a HTTP Referer header.

 

RewriteCond %{HTTP_REFERER} !^$                                  
RewriteCond %{HTTP_REFERER} !^http://www.quux-corp.de/~quux/.*$ [NC]
RewriteRule .*\.gif$        -                                    [F]

RewriteCond %{HTTP_REFERER}         !^$                                  
RewriteCond %{HTTP_REFERER}         !.*/foo-with-gif\.html$
RewriteRule ^inlined-in-foo\.gif$   -                        [F]

Link to post
Share on other sites

a ja vaig zinaat to kursh tavu bildi savaa lapaa iemonteejis ta paliek tikai $_SERVER['HTTP_REFERER'] bet to browsers kursh prasa tavu bildi var arii tev nestaastiit :)

Link to post
Share on other sites

Nu peec idejas jau runa ir tak par to bildes tiek croslinkotas t.i. no vienas weblapas liktas citaa un tur jau refereri suuta lietotaaja paarluuks liidz ar to viltiigam/neviltiigam iisti nav vietas :) jo apmekleetaajam tak principaa ir pie kaajas no kurienes attieciigais atteels ielaadeejas (un ja nelaadeejas tad vinsh vaino weblapas veidotaaju).

Un lai taisiitu kaut kaadu uberscriptu kursh suuta vai nesuuta "upura" webserverim (uz kuru linko bildes) http headerus manliekas ir lielaaka saape nekaa vienkaarshi njemt un noliichot visus atteelus.

 

Pie kam ja arii apmekleetaajs ir tik "viltiigs" (lieto tur hax0red browseri vai nez veel ko) lai arii vinjam tiek (man piemeeram nebuutu zheel :) )

Link to post
Share on other sites
  • 2 weeks later...
×
×
  • Create New...