Forum Moderators: phranque
I've been having aproblem with people hotlinking to the zip files hosted on my server. My bandwidth is limited, and google is paying less and less. To fix this, I would like visitors to be redirected to a download page when accessing a zip on my server that they were brought to from a different site.
So here's a sample scenario of what I WANT to happen:
1) A user goes to example.com (NOT my site) and tries to download a file on my server, FILE_NAME_HERE.zip (FILE_NAME_HERE can be any one of about 150 files).
2) Instead of directly downloading it, they are brought to www.mysitenamehere.com/download.php?file=FILE_NAME_HERE, where it displays an ad and starts the download within a few seconds.
3) They download the file, everything is fine and dandy. I get paid for the bandwidth (in the form of showing google ads) the hotlinking site would have stolen had I not put in protection.
Any suggestions or help is greatly appreciated!
The only problem is that I have to allow blank referrers due to firewall problems, and sites can do a JS popup in IE to the file (no refferer). But there is no way to fix this, because I don't want some firewall users to have problems downloading.
I was wondering if you could please exaplin some on it to me, especially the %1 part. It's only in the code once and it's automatically set the the filename.
Thanks once again!
RewriteRule ([^/.]+)\.zip$ www.mysitenamehere.com/download.php?file=$1 [R,L]
Jim