Jump to content
php.lv forumi

Bilžu aisardzība.


Wuu

Recommended Posts

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?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...