Citat:
Originally posted by eg0master@Dec 6 2004, 17:27
En lösning med referer duger inte?
DVS at bara bilder där referer är den egna sajten visas? Kollar ju inte om personen är inloggad, men han måste komma via rätt "sida" iaf.
Borde väl gå at lösa via .htaccess
|
Mycket riktigt. Följande information, hittade jag på
http://www.javascriptkit.com/howto/htaccess10.shtml
Finns även att läsa i en tråd:
http://www.webmasternetwork.se/index.php?a...42&hl=link&s=wn
Citat:
With all the pieces in place, here's how to disable hot linking of images on your site. Simply add the below code to your .htaccess file, and upload the file either to your root directory, or a particular subdirectory to localize the effect to just one section of your site:
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?mydomain.com/.*$ [NC]
RewriteRule \.(gif|jpg)$ - [F]
Be sure to replace "mydomain.com" with your own. The above code causes a broken image to be displayed when its hot linked.
If you're feeling bitter, you can set things up so an alternate image is displayed in place of the hot linked one. The code for this is:
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?mydomain.com/.*$ [NC]
RewriteRule \.(gif|jpg)$ http://www.mydomain.com/nasty.gif [R,L]
Same deal- replace mydomain.com with your own, plus nasty.gif.
|