GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Perfect File Protection (https://gfy.com/showthread.php?t=32792)

REMbraNT 04-22-2001 12:44 PM

Perfect File Protection
 
I have problems to make a good hotlink protector system.I use a php redirect file but I have a little problem with it.In this case when the user want to dl a file called 22.jpg he will be asked to dl the file as redirect.php.How can I keep the original file at download?

<?
if ( $HTTP_REFERER=="http://www.myname.com/images/members/") {
$filename="/home/images/data/" . $QUERY_STRING;
$mimetype = `file $filename | magic2mime`;
header("Content-type: $mimetype");

$fp = @fopen ($filename, "r") or die("Nincs ilyen file!");
while (!feof ($fp)) {
$buffer = fread($fp, 4096);
echo $buffer;
}
fclose($fp);
} else {
include("../../data/error.html");
}
?>

TFCash 04-22-2001 12:59 PM

REMbraNT =

I would suggest that you not use php for protecting your images, and instead use the mod_rewrite that can be enabled on the apache web server. I've done testing on this before (Since we are a web host, we like to know what works best for our customers http://bbs.gofuckyourself.com/board/smile.gif ) And using php will add more overhead than the mod_rewrite will.


Tim

REMbraNT 04-22-2001 01:04 PM

hardcorehosting and what works best for your costumers? http://bbs.gofuckyourself.com/board/smile.gif
I need an idea

TFCash 04-22-2001 01:20 PM

Ask your host if they have mod_rewrite compiled into their apache web server. If so you should be able to create a file call .htaccess in your images directory that is something like this:

AuthUserFile /dev/null
AuthGroupFile /dev/null

RewriteEngine On

RewriteCond %{HTTP_REFERER} !^http://www.yourdomain.com.* [NC]
RewriteCond %{HTTP_REFERER} !^http://yourdomain.com.* [NC]

RewriteRule /* http://www.yourdomain.com/index.html [R,L]

That way only you can call the images from those directories, that have proper permission.

To see an example of what I mean try looking at this photo, it will automatically take you to my main page.
http://www.lesbian-pictures.com/Sun/15/pic1.jpg

it will redirect you back to http://www.lesbian-pictures.com/

And I don't want to hear any shit about the look of the site either, we just got the domain and I threw it together so that I don't lose all that wonderful traffic that my pain in the ass from Turkey paid for. In case your not sure what I'm talking about you can read the thread here about it http://bbs.gofuckyourself.com/board/smile.gif
http://bbs.gofuckyourself.com/board/...ML/002711.html

Tim

REMbraNT 04-22-2001 01:33 PM

Ok hardcore I will inform you if it works well for me


All times are GMT -7. The time now is 02:01 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123