ok heres a simple way , feel free to modify it.. if you know of any other tricks , feel free to let me know
Save the following as index.php and put it in a folder with your videos
Code:
<?php
$mov = $_GET['x'];
echo "<center>Add an advertisement here - dont use quotes<br><embed src=$mov.wmv></embed>";
?>
( if your using mpg/avi videos change the code to mpg/avi in both files)
ok now make a new folder in your main directory, save the following as .htaccess ( modify the url to point to the directory with your videos )
Code:
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^(.*)\.wmv http://yoursite.com/videos/index.php?x=$1 [nc]
ok now what this will do is , when you call a video or someone hotlinks a video it will call the video and display it in an html page so you can add advertising and such..
Now keep in mind this doesnt actually prevent hotlinking all it does is rewrite the request to a different folder , so if you try to get
http://yourserver.com/protected/video.wmv it would get the video from a different folder and write it into an html file.. the end video is still unprotected , so if someone views source of the html they can simply get the redirected movie url
BUT heres what you do.. you can simply rename the folder with your protected videos then change the .htaccess file to reflect that every so often , you dont have to change any of your links as they will just be redirected to the new folder without any changes on your part
synopsis.
If you normally had a link like
http://yourserver.com/1/video.wmv it will rewrite it as
http://yourserrver.com/2/video.wmv , embed it in a page so you can add advertising , if the hotlinkers ever find where the true video resides you can simply rename the destination folder without having to change any exisiting links on your page , (i.e. you can link using
http://yourserver.com/1/video.wmv and never have to change it regardless of where the real videos reside )