Prevent Hotlinking and Bandwidth Theft

Modifications for phpBB3. Try the Mods here and share Your own Mods
There is no support here! Only Read Access!
Forum rules
You dont have to use ModX or make your mod AutoMod compatible. A simple textfile is fine
But if you post Mods here You also have to give support
User avatar
Stoker
Site Admin
Site Admin
Posts: 3540
Joined: 12 May 2008, 23:26
BBCodes: 239
Favourite BBCode: Anipro
Favourite MOD: PrettyPhoto
Location: Denmark
Contact:

Prevent Hotlinking and Bandwidth Theft

Post by Stoker »

Prevent Hotlinking and Bandwidth Theft

Moved: viewtopic.php?f=45&t=1306
Attachments
prevent_hotlinking.zip
(105.16 KiB) Downloaded 803 times
Board rules! No PM support
cisco007
BBCoder VI
BBCoder VI
Posts: 1015
Joined: 16 Mar 2010, 18:14
Location: Don't really know!

Re: Prevent Hotlinking and Bandwidth Theft

Post by cisco007 »

thanks, that was fast!

[edit]so like the post said, is this only for uploaded attachments? How can i protect other files, lets say a .flv that i have in another folder so that no one can use it only my site? can i use something like this!?[/edit]
Last edited by cisco007 on 25 Mar 2010, 15:51, edited 1 time in total.
Reason: added a question!
User avatar
Fire-Fox
BBCoder IV
BBCoder IV
Posts: 275
Joined: 22 Mar 2010, 13:24
Location: Denmark

Re: Prevent Hotlinking and Bandwidth Theft

Post by Fire-Fox »

Great mod.

Working like it should :)
User avatar
Fire-Fox
BBCoder IV
BBCoder IV
Posts: 275
Joined: 22 Mar 2010, 13:24
Location: Denmark

Re: Prevent Hotlinking and Bandwidth Theft

Post by Fire-Fox »

cisco007 » 24 Mar 2010, 21:03 wrote:thanks, that was fast!

[edit]so like the post said, is this only for uploaded attachments? How can i protect other files, lets say a .flv that i have in another folder so that no one can use it only my site? can i use something like this!?[/edit]

I would think so...

Do the same steps but the the flv folder instead, while putting the .htaccess on the flv folder and change the script so it fits :)
User avatar
Stoker
Site Admin
Site Admin
Posts: 3540
Joined: 12 May 2008, 23:26
BBCodes: 239
Favourite BBCode: Anipro
Favourite MOD: PrettyPhoto
Location: Denmark
Contact:

Re: Prevent Hotlinking and Bandwidth Theft

Post by Stoker »

Yes, upload a htaccess file to the folder where the flv files is located:

Code: Select all

RewriteEngine On
RewriteCond %{HTTP_REFERER} !^http://(.+.)?phpbb3bbcodes.com/ [NC]
RewriteCond %{HTTP_REFERER} !^$
RewriteRule .*.(flv)$ ../stop.gif [L]
Note that I just changed php with flv
Board rules! No PM support
cisco007
BBCoder VI
BBCoder VI
Posts: 1015
Joined: 16 Mar 2010, 18:14
Location: Don't really know!

Re: Prevent Hotlinking and Bandwidth Theft

Post by cisco007 »

i have done it, and it don't work! Maybe have something to do with my server!
User avatar
Stoker
Site Admin
Site Admin
Posts: 3540
Joined: 12 May 2008, 23:26
BBCodes: 239
Favourite BBCode: Anipro
Favourite MOD: PrettyPhoto
Location: Denmark
Contact:

Re: Prevent Hotlinking and Bandwidth Theft

Post by Stoker »

I think it is because the flv is cached in your browser.
Try post one in the testforum.
Board rules! No PM support
User avatar
Fire-Fox
BBCoder IV
BBCoder IV
Posts: 275
Joined: 22 Mar 2010, 13:24
Location: Denmark

Re: Prevent Hotlinking and Bandwidth Theft

Post by Fire-Fox »

Thanks for the mod stoker :)
User avatar
IpHeX
BBCoder II
BBCoder II
Posts: 23
Joined: 23 Mar 2010, 21:02

Re: Prevent Hotlinking and Bandwidth Theft

Post by IpHeX »

Great mod, thank you for sharing. :)
User avatar
Stoker
Site Admin
Site Admin
Posts: 3540
Joined: 12 May 2008, 23:26
BBCodes: 239
Favourite BBCode: Anipro
Favourite MOD: PrettyPhoto
Location: Denmark
Contact:

Re: Prevent Hotlinking and Bandwidth Theft

Post by Stoker »

Stoker » 25 Mar 2010, 21:13 wrote:I think it is because the flv is cached in your browser.
Try post one in the testforum.
:beat:
Board rules! No PM support
Locked