Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 04-22-2001, 12:44 PM   #1
REMbraNT
Confirmed User
 
Industry Role:
Join Date: Feb 2001
Location: Hungary
Posts: 241
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");
}
?>
REMbraNT is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-22-2001, 12:59 PM   #2
TFCash
Confirmed User
 
Industry Role:
Join Date: Apr 2001
Posts: 1,738
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 ) And using php will add more overhead than the mod_rewrite will.


Tim
TFCash is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-22-2001, 01:04 PM   #3
REMbraNT
Confirmed User
 
Industry Role:
Join Date: Feb 2001
Location: Hungary
Posts: 241
hardcorehosting and what works best for your costumers?
I need an idea
REMbraNT is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-22-2001, 01:20 PM   #4
TFCash
Confirmed User
 
Industry Role:
Join Date: Apr 2001
Posts: 1,738
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/...ML/002711.html

Tim
TFCash is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-22-2001, 01:33 PM   #5
REMbraNT
Confirmed User
 
Industry Role:
Join Date: Feb 2001
Location: Hungary
Posts: 241
Ok hardcore I will inform you if it works well for me
REMbraNT is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.