Okay, I'll explain this the best I can. I have a Image/Video Hosting website that allows people to view Images/Videos on the website after uploading them. Simple, however I've had a big problem with people hotlinking videos lately. What they are doing is just visiting the actual Videolink which cuts out any of my ads. When they do this 50,000 Times a Day, hurts my bottomline.
So I went to work on some better hotlinking protection, that can achieve the following.
- Allows people to view videos from inside my webpage.
- Allows people to view/hotlink images from my webpage.
- DOESNT allow people to view videos from outside my webpage.
-DOESNT allow people to even directly link to my videos.
After researching the various ways to do the above, I'm still looking for a solution. The main "kink" in my plan, is I CANT allow direct linking to videos, since this is the biggest problem. So that doesnt allow me to effectively use Cpanel's built in stuff.
One idea i'm pondering is to have a .HTACCESS have the Video Specific File only allow access to videos from on the actual Webpage, but not sure if thats possible.
If someone tries to hotlink an .avi file they will get redirected to the URL seen in the RewriteRule line. Modify yourhost.com to your domain name, modify the redirection URL, stuff in your .htaccess file.
Well I got this method working I believe, but still allowed direct access so trying something else.
Basically I set the Files Folder before Public_html and did some permissions adjustments to make it inaccesible via a browser. Now I'm modifying my filepage to load the file upon visiting. I've got downloads working using this code: