WebmasterSite.net: PHP scripts to enable your creativity
WSN Links PHP Directory Software
PHP Scripts Webmaster Links Support Forums


Hotlinking Exceptions

Version:
printPrint


Hotlinking Exceptions
mrhsean
Beginner

Usergroup: Member
Joined: Jan 17, 2004
Total Topics: 2
Total Posts: 2
Posted 10/18/04 - 10:39 PM:
quote post
#1
Is there a way to prevent hotlinking from all sites except ones specified.

I guess I am asking... if there is a way to create exceptions to the No Hotlinking rule.
Paul
Administrator
Avatar

Usergroup: Administrator
Joined: Dec 21, 2001
Location: Northern California
Total Topics: 56
Total Posts: 5853
Posted 10/18/04 - 10:44 PM:
quote post
#2
Open download.php and replace if ($settings->nohotlink == 'yes')

{

if ( (!strstr(getenv('HTTP_REFERER'), $_SERVER['SERVER_NAME'])) && (getenv('HTTP_REFERER') != '') && (strstr(getenv('HTTP_REFERER'), 'http')) )

{

die("No hotlinking allowed");
with
if ($settings->nohotlink == 'yes')

{

if ( (!strstr(getenv('HTTP_REFERER'), $_SERVER['SERVER_NAME'])) && (getenv('HTTP_REFERER') != '') && (strstr(getenv('HTTP_REFERER'), 'http')) && !strstr(getenv('HTTP_REFERER'), 'exceptionsite.com') )

{

die("No hotlinking allowed");

Replacing exceptionsite.com with the domain you wish to allow.

_____________________
"Do things you love doing, because then it ain't work. Don't do something you don't really enjoy, because you're never going to work hard enough at it." - Bob Young, founder of Red Hat
Search thread for
Download thread as


You don't have permission to post.

Please login or register.

   
 
© 2008 Paul Knierim. All rights reserved.