| Hotlinking Prevention: CGIProxy and PHPProxy |
|
| Thursday, 14 December 2006 | |
|
Running a web proxy server using CGIProxy and PHPProxy is a risky business. The script as is does not have any hotlinking prevention. That makes other can just go to your proxied pages without going through your front page. Even worse, they can link picture, download, and anything through your web proxy which make your bandwidth usage up to the roof.
CGIProxy:
This code basically check for referer and if it's blank or not from our domain, redirect to our domain main page. Open your nph-proxy.cgi on text editor and find:
Insert my code below that line. PHPProxy:
This code basically do the same thing as CGIProxy code above. I found it on some forum and it works like a charm. Open your index.php and put it right after:
While this will save you a lot of headache trying to prevent your bandwidth over charge from your ISP, you should always monitor your bandwidth usage. Don't hesitate to pull the plug when your bandwidth usage is already over your quota from ISP. And remember if your website log show your bandwidth usage is 100GB, the reality is it already use double of that since web logs didn't count your incoming traffice, only your outgoing. |
|
| Last Updated ( Friday, 15 December 2006 ) |
| Next > |
|---|

