Aknot Posted February 19, 2004 Share Posted February 19, 2004 I have/will have over 150 (if not more) scans of Sports cards I own. I already have the makings of the "list" that shows card number, year, company, player. Along with that if I have a scan of it opening in another window when "clicked". I want to make it so the scans/pictures can not be "remote linked". (is that the right term?) Meaning I can do this: Now but I do not want people (even me) to be able to do that. How would I go about doing that? Also creating an "error" message for soemone that does attempt to remote link. Thanks. Quote Link to comment Share on other sites More sharing options...
ThumpAZ Posted February 19, 2004 Share Posted February 19, 2004 There is a function in cPanel that allows you to disable Hotlinking called HotLink Protection under the Site Management section. You simply activate this and select the areas you want to protect. -GG Quote Link to comment Share on other sites More sharing options...
Aknot Posted February 19, 2004 Author Share Posted February 19, 2004 Cool. So is it called "Hot Linking" or "Remote Linking" or both? Quote Link to comment Share on other sites More sharing options...
Aknot Posted February 19, 2004 Author Share Posted February 19, 2004 Test FYI I deleted this file.... Quote Link to comment Share on other sites More sharing options...
Aknot Posted February 19, 2004 Author Share Posted February 19, 2004 hmmmm the "test" post contained a linked picture that is NOT in one of the domains that I have "restricted". So it is either "all" or none? Quote Link to comment Share on other sites More sharing options...
Aknot Posted February 19, 2004 Author Share Posted February 19, 2004 It "appears" it is an all or nothing "fix". Does anyone know of another way to protect from "hotlinking/remotelinking"? Thanks Quote Link to comment Share on other sites More sharing options...
taznumber1 Posted February 19, 2004 Share Posted February 19, 2004 you just turn it on, and then in the Urls to Allow Access: box put the urls like www.example.com in their. Then if you want a little page to come up if they try to link to your site you just put in a page name in the next box below the allow url and then it will turn it on. It is really easy to do, and it the only way to keep other sites from linking to your images. Quote Link to comment Share on other sites More sharing options...
Aknot Posted February 19, 2004 Author Share Posted February 19, 2004 taz, Yes that works. BUT lets say I have www.facciolli.com. And two subs off that, Dolphins and AA. The "pics" in Dolphins I do not want to be hot/remote linkable BUT the ones in the AA sub I do. I believe it is an "all" or nothing with Cpanel. Have checked around and it appears there is some "code" I can drop that will restrict it here: http://www.htmlbasix.com/disablehotlinking.shtml But Im a little leary of using "code generators". Quote Link to comment Share on other sites More sharing options...
Aknot Posted February 25, 2004 Author Share Posted February 25, 2004 Glenn, Am I correct in my assumption? Quote Link to comment Share on other sites More sharing options...
MikeJ Posted February 25, 2004 Share Posted February 25, 2004 (edited) You can do what cPanel does, on a directory basis, but you'll have to do it manually. For any directory tree you want protected, create in the topmost directory of that directory tree, a .htaccess file, edit it, and put something like the following in it: >RewriteEngine on RewriteCond %{HTTP_REFERER} !^http://******/.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://******$ [NC] RewriteCond %{HTTP_REFERER} !^http://www.******/.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://www.******$ [NC] RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ http://******/invalidlink.html [R,NC] All of the RewriteCond lines would need to be changed/added as needed to accomodate any valid domain URL's that are used to access your site. The RewriteRule contains the extensions to protect, and the URL to redirect someone who's trying to hotlink or directly access one of the protected files. Again, change as needed. Btw, if you don't want a redirected URL, you can change the RewriteRule to something like this: >RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ - [F,NC] These above examples are exactly how cPanel writes it, for what it's worth. ... I just looked at your link now, and yes, it looks like that will do what you need as well. It should generate something like that above. Edited February 25, 2004 by Big Gorilla 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.