Unstoppable Domains โ€” AI Assistant

Bandwidth MOD

SpaceshipSpaceship
Watch
Bandwidth MOD

Version:
1.1

Installation: Simply copy and paste the mod code into your index.php page, just below the '<?php' at the top of the page.

PHP:
/*
Bandwidth MOD 1.1
*/

// allow hotlinking from these sites, seperate by comma (make sure you eneter your site's domains)
$domains="www.yourdomain.com,yourdomain.com";

// convert domains into an array
$domains=explode(",",$domains);

  // if there is a request:
  if($_GET['q']!="")
  {
  // get referer
  $referer=explode("/",($_SERVER['HTTP_REFERER']));
    // if the referer is not allowed:
    if(!in_array($referer[2],$domains))
    {
    // redirect to homepage and finish script
    header("Location: http://".$domains[0]."/");

    exit();
    }
  }

/*
END MOD
*/
Best of luck
 
Last edited:
17
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
AfternicAfternic
Giving this one a bumpage :tu:
 
0
•••
I just used this and it works great, just what I was looking for. Rep+ for Rhett and Eric, for both of their contributions.
 
0
•••
0
•••
thank you very much for the great help.

thanks i would also be waiting for your next mod. with something new.

have a nice day
 
0
•••
Last edited:
0
•••
BillyConnite said:
Well, a new version of phproxy came out a little while ago :), so I guess it's time for me to check and update this little mod heh.

Reporting back soon.
I think it has something for hotlinking already built-in.
 
0
•••
Last edited:
0
•••
Hi,
Still think your code may be usefull for other sites, not just PHproxy.

By the way, isn't the same thing achievable with .htaccess?

- Vince
 
0
•••
0
•••
SecondVersion said:
.htaccess:
Code:
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^domain.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^domain.com$ [NC]
RewriteCond %{QUERY_STRING} !^$
RewriteRule ^(.*)$ http://www.domain.com/ [R=301,L]
Untested, however.

Ah, missed or forgot about that post. :red:
What difference is there to what I found?

Code:
RewriteEngine On
RewriteCond %{HTTP_REFERER} . 
RewriteCond %{HTTP_REFERER} !^http://(www\.)?domain\.com [NC] 
RewriteRule ^(.*)$ http://domain.com/$1 [L,R=301]

Thanks very much.

- Vince
 
0
•••
Appraise.net
Escrow.com
Spaceship
Rexus Domain
CryptoExchange.com
Domain Recover
CatchDoms
DomainEasy โ€” Zero Commission
DomDB
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back