Wuu Posted May 29, 2010 Report Share Posted May 29, 2010 Man ir bilžu hostinga webs, bet tā ka hostinga resursi nav lieli. Vēlētos bloķēt bilžu izvietošanu iekš citiem domainiem. Vēlētos lai bildes tikai rādītos "uoc.lv"domainā un "*.uoc.lv" subdomainos. To laikam varēja izdarīti ar .htaccess? Quote Link to comment Share on other sites More sharing options...
daGrevis Posted May 29, 2010 Report Share Posted May 29, 2010 Ar PHP nevar? Quote Link to comment Share on other sites More sharing options...
mefisto Posted May 29, 2010 Report Share Posted May 29, 2010 RewriteCond %{HTTP_REFERER} !^http://([a-zA-Z0-9]\.)?uoc\.lv/.*$ [NC] RewriteRule \.png|jpg - [F] Kaut kā šitā. Apmēram. Quote Link to comment Share on other sites More sharing options...
aldis Posted May 29, 2010 Report Share Posted May 29, 2010 Man savām vajadzībām .htacess failā ir šādas rindas, pret bilžu ņemšanu. Ķip, liste ar adresēm kurās drīkst hotlinkot manas bildes. Un mazs .gif failiņš kurā parādās, ka hotlinkoshana liegta. Strādā ja esi ieslēdzis mod_rewrite, un browsers sūta refer linku. Piemēram Google Chrome šitais joks nestrādāja, kur grib tur hotlinko. RewriteEngine on RewriteCond %{REQUEST_FILENAME} .*jpg$|.*gif$|.*png$ [NC] RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !bedre\.lv [NC] RewriteCond %{HTTP_REFERER} !nekur\.lv [NC] RewriteCond %{HTTP_REFERER} !google\. [NC] RewriteCond %{HTTP_REFERER} !search\?q=cache [NC] RewriteCond %{HTTP_REFERER} !localhost [NC] RewriteRule (.*) nekope_bildi.gif Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.