Seite 1 von 1

[MOD] Hotlink Schutz

Verfasst: 21.08.2008 07:59
von Foren Mitglied
MOD title: Prevent hotlinking
MOD description: Here is a little addon for Your phpBB3 board that prevents hotlinking and people stealing Your bandwidth.
It affects all files that are uploaded with the "Upload attachment" function.
This way it only causes very little server load because it only checks files placed in the download folder.
But it is possible to protect everything :)

MOD version: 1.0.1
phpBB version: Tested on 3.0.0 - 3.0.2
Installation Time: 1 minute

Quelle: http://www.phpbb.com/community/viewtopi ... &t=1093305

Anleitung:
Lade die ZIP Datei herunter, entpacke sie und öffne root/download/.htaccess
Es wird dann so aussehen:

Code: Alles auswählen

    RewriteEngine On
    RewriteCond %{HTTP_REFERER} !^http://(.+.)?yourdomain.com/ [NC]
    RewriteCond %{HTTP_REFERER} !^$
    RewriteRule .*.(php)$ ../stop.gif [L]
Ändere nun yourdomain.com in Deinen Domain Namen.
Beispiel:

Code: Alles auswählen

    RewriteEngine On
    RewriteCond %{HTTP_REFERER} !^http://(.+.)?lpi-clan.de/ [NC]
    RewriteCond %{HTTP_REFERER} !^$
    RewriteRule .*.(php)$ ../stop.gif [L]
Lade nun die von Dir geänderte Datei von root/download/.htaccess in Dein Forums-Ordner "download"
Lade das Bild stop.gif in den Forums-Hauptordner ( dort wo auch die memberlist.php liegt )
Du kannst natürlich auch ein anderes Bild verwenden... benenne es nur in " stop.gif " um.

FAQ:
F - Was ist, wenn ich weitere Domains erlauben möchte meine Bilder direkt zu verlinken?
A - Das ist relativ einfach. Sagen wir mal, das die Seite phpbb.de die Bilder direkt verlinken darf, dann benutze diesen Code:

Code: Alles auswählen

    RewriteEngine On
    RewriteCond %{HTTP_REFERER} !^http://(.+.)?lpi-clan.de/ [NC]
    RewriteCond %{HTTP_REFERER} !^http://(.+.)?phpbb.de/ [NC]
    RewriteCond %{HTTP_REFERER} !^$
    RewriteRule .*.(php)$ ../stop.gif [L]
Du kannst noch weitere zustätzliche Domain Namen angeben wenn Du sie benötigst. Füge einfach eine weitere Zeile wie im o.g. Beispiel ein.