TCH-Tim Posted January 17, 2006 Share Posted January 17, 2006 I tried searching the forums but couldn't find exactly what I was looking for. I'm not sure if hotlink protection is the term I should be using, but here's what I want to do: file.wmv has been downloaded 1800 times from a site that is not mine. I would like to redirect people trying to download file.wmv to a specific page on my site where they can download it. At least that way there's a shot I will get traffic to other parts of my site. I don't want to turn on hotlink protection for the entire site or even the entire folder where file.wmv resides. I just want to redirect downloaders of that one file. Thanks in advance. Quote Link to comment Share on other sites More sharing options...
TCH-Rob Posted January 17, 2006 Share Posted January 17, 2006 I think a redirect in your htaccess could accomplish that. Something like; >redirect /yoursite/yourfolder/file.wmv http://www.yourtchsite.com/yourpage.ext Something along those lines should work. Quote Link to comment Share on other sites More sharing options...
TCH-Rob Posted January 17, 2006 Share Posted January 17, 2006 On second thought, the above may not work as even if you do allow them to access it from a different part of your site it will still redirect them. Ignore the above post. Quote Link to comment Share on other sites More sharing options...
TCH-Bruce Posted January 17, 2006 Share Posted January 17, 2006 It would work if he renames the file to download. Quote Link to comment Share on other sites More sharing options...
TCH-Rob Posted January 17, 2006 Share Posted January 17, 2006 Change the name of the file and then link to the new name from the page they are being redirected to? Sure it would, as long as the person causing this issue in the first place does not find out and change his link to match the renamed file. Quote Link to comment Share on other sites More sharing options...
TCH-Tim Posted January 17, 2006 Author Share Posted January 17, 2006 Rob is right. Changing the name will only work for so long. The search engines will catch up with me. I may be asking a lot by leaving everything so open and expecting to restrict access to one file, but I have to believe there's a way. Quote Link to comment Share on other sites More sharing options...
TCH-Bruce Posted January 17, 2006 Share Posted January 17, 2006 You could always put the file into a password protected directory and provide the password on your page only. Quote Link to comment Share on other sites More sharing options...
TCH-Tim Posted January 17, 2006 Author Share Posted January 17, 2006 Too complicated on the user end. Would like it to be seamless. Quote Link to comment Share on other sites More sharing options...
TCH-Bruce Posted January 17, 2006 Share Posted January 17, 2006 Could you check for the referrer to the file and direct them to a page on your site that way? Quote Link to comment Share on other sites More sharing options...
wampthing Posted January 17, 2006 Share Posted January 17, 2006 I have the same question about a jpg of my daughters headstone that some kid on a social networking site is using as her avatar. I understand that once you put something on the web, you cant control how it is used. I just hate seeing the stats for that file being so abnormally large. I'm not too overly sensitive about it (otherwise it wouldn't be on the web), I just hate the feeling of how irreverent it is. Quote Link to comment Share on other sites More sharing options...
TCH-Andy Posted January 17, 2006 Share Posted January 17, 2006 You can either put a redirect on that referrer (as Bruce suggests) or you should be able to do hotlinking on the single file by editing the .htaccess and adding something like; >RewriteEngine on RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http://mywebsite.com/ [NC] RewriteCond %{HTTP_REFERER} !^http://mywebsite.com [NC] RewriteCond %{HTTP_REFERER} !^http://www.mywebsite.com/ [NC] RewriteCond %{HTTP_REFERER} !^http://www.mywebsite.com [NC] RewriteRule file.wmv - [F,NC] Quote Link to comment Share on other sites More sharing options...
TCH-Tim Posted January 17, 2006 Author Share Posted January 17, 2006 Thanks Andy, that got me on the right track. Took me a few tries to realize it needs to be in the /public_html/ .htaccess, not the /public_html/files/ .htaccess. Made a minor modification to Andy's suggestion. Rather than forbidding the file, I redirect the visitors to the actual post page that discusses the file, and they can get to it from there. Changed the last line of Andy's code to: >RewriteRule file.wmv http://www.mysite.com/somepostpage [R,NC] Appreciate the help guys. Quote Link to comment Share on other sites More sharing options...
TCH-Rob Posted January 18, 2006 Share Posted January 18, 2006 Glad to see you got it worked out. Quote Link to comment Share on other sites More sharing options...
TCH-Andy Posted January 18, 2006 Share Posted January 18, 2006 Glad you have it sorted, Thanks for letting us know the final solution you came up with Quote Link to comment Share on other sites More sharing options...
TCH-Mark Posted January 18, 2006 Share Posted January 18, 2006 Hello, Glad everything is sorted and goodluck with the fix and your website Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.