umz Posted February 3, 2005 Posted February 3, 2005 I have half a dozen or more subdomains but I only have one that I would like to set up Hotlink Protection. I tried to find a tutorial on how, but have not been able to find one as of yet so I'm giving up & asking for help If I'm just being daft & overlooking it I apologize & would appreciate a point in the right direction (I'm not even really sure I've posted this in the right place! ) Thanks! Quote
TCH-RobertM Posted February 3, 2005 Posted February 3, 2005 Hi UMZ, I cannot help you with what your asking but I am sure someone here will shortly. Welcome to the forums, a great place for help I did come accros this turorial though It might help you hotlink tutorial Quote
TCH-Rob Posted February 3, 2005 Posted February 3, 2005 Put an .htaccess file in the main folder of the subdomain and put the following in it; >RewriteEngine On RewriteCond %{HTTP_REFERER} !^http://(www\.)?your-domain\.com/ [NC RewriteCond %{HTTP_REFERER} !^$ RewriteRule \.(jpe?g|gif|bmp|png)$ images/not-for-u.jpg [L] This will prevent anything but your domain from being able to show the images. The not-for-u.jpg should be an image stating no hotlinking or something like that. Quote
TCH-Bruce Posted February 3, 2005 Posted February 3, 2005 Welcome to the family and forums umz! Quote
umz Posted February 3, 2005 Author Posted February 3, 2005 Thank you Bruce. I have loved TCH in the almost year that I've been here & often stalk the forum for random bits of information Ok, now I'm getting an "500 Internal Server Error" when I try to access that subdomain. Did I set up the .htaccess file incorrectly? Quote
TCH-Bruce Posted February 4, 2005 Posted February 4, 2005 Rob's post was in error. RewriteCond %{HTTP_REFERER} !^http://(www\.)?your-domain\.com/ [NCIt should have read:RewriteCond %{HTTP_REFERER} !^http://(www\.)?your-domain\.com/ [NC] He was missing the closing ] And remember to replace the your-domain with your actual domain name. Quote
umz Posted February 4, 2005 Author Posted February 4, 2005 I've got to be doing something wrong. Can I blame in on my lack of HTML skills & the cold meds I've been taking? The 500 error is gone now but I can hotlink to the images in that subdomain. Here's the code as I have it written: RewriteEngine OnRewriteCond %{HTTP_REFERER} !^http://(cybervovvar\.)?simplesuccess\.us [NC]RewriteCond %{HTTP_REFERER} !^$ RewriteRule \.(jpe?g|gif|bmp|png)$ images/notforyou.jpg [L] I created the .htaccess file by writing it in an HTML editor program I have & saving it as ".htaccess". When it uploaded it now reads as .htaccess If I click for information on the files type it tells me it's a File Type: ASCII text, with CRLF line terminators Any ideas on what I'm doing wrong? btw- Thank you so much for your help so far, you guy's really are great Quote
TCH-Rob Posted February 4, 2005 Posted February 4, 2005 Try creating it in Notepad instead to make sure it is only the text that want it to be. Some editors like to put extra items in. Quote
umz Posted February 4, 2005 Author Posted February 4, 2005 Nope...that didn't work either. Perhaps I'm making the file wrong? This time I did it in notebook & named it .htaccess which then turned to .htaccess.txt so I uploaded that & with my ftp program renamed it .htaccess Quote
TCH-Rob Posted February 4, 2005 Posted February 4, 2005 Try making the file in your cPanel file manager and see if that works. Quote
kellybellydotnet Posted February 5, 2005 Posted February 5, 2005 The 500 error is gone now but I can hotlink to the images in that subdomain. One other thing I've come across while testing out hotlinking on my sites: make sure you clear your cache first. If you have a copy of the images in your cache, there's a chance that that's why they're showing up for you. I've run myself in circles before trying to figure out why I can see my supposedly unlinkable images on other sites when all it was was a cached image. So clear the cache and then reload the page to make sure for certain that the hotlinking isn't working. Quote
umz Posted February 6, 2005 Author Posted February 6, 2005 Ooooo Cache...brill! Thanks Kelly! Thank you all so very much! It's working great now It's no wonder I love TCH! Quote
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.