i want to host my files on my server .... but i want to prevent form leecher that my files direct links to their server ...... for example : www.mysite.com/myfile.rar it is very easy to share this link ......but any solution ..that give me security ...that always user come to my site and download this file .... what idea about referral code OR .httacces code
You can use .htaccess to restrict access to users that are using your domain. example of that here Nothing is 100% though. Referral headers can be spoofed easily--as can most other things you'd use to protect your files.
You can use .htaccess to do stop leeching attempts. Example tutorials are here: http://www.bloghash.com/2006/12/apache-mod_rewrite-examples/ http://www.addedbytes.com/apache/url-rewriting-for-beginners/ http://www.askapache.com/htaccess/advanced-htaccess-tricks-for-securing-sites.html
For the most security you could do something like give links such as down.php?id=12 which corresponds to a database entry for the file in your DB. Then you could have the files really hosted at yoursite.com/uploads/randomfilename.ext and then users would have to call the file at the down.php?id=12 or something URL. Then the down.php could check and see if you want to give the file, such as if they are logged in or not, the referring url, etc.