Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
hotlink protection
camo
New
Hi, Im using a
BUT NOT ANYMORE
1. what is the modern way to do this?
2. (if I can sort that) How do I add it to my forum .htacces to use there too? Or can I modify the original (main website .htaccess) to cover both the forum
http://www.camosreptiles.com.au/forum/
and my classifieds
http://www.camosreptiles.com.au/classifieds/
P.S sorry about the other two post, didnt realise writing
dot htaccessrewrite condition to redirect if an image is hotlinked from my website. It USED TO WORK
BUT NOT ANYMORE
RewriteEngine OnA few questions:
RewriteCond %{HTTP_REFERER} !^http://(www\.)?camosreptiles.com.au(/)?.*$ [NC]
RewriteRule .*\.(gif|jpg|png|jpeg|bmp)$ http://www.camosreptiles.com.au/hotlink.shtml [R,NC]
1. what is the modern way to do this?
2. (if I can sort that) How do I add it to my forum .htacces to use there too? Or can I modify the original (main website .htaccess) to cover both the forum
http://www.camosreptiles.com.au/forum/
and my classifieds
http://www.camosreptiles.com.au/classifieds/
P.S sorry about the other two post, didnt realise writing
dot htaccesswould screw something.
Tagged:
0
Best Answer
-
camo NewOk, after much messing about, The following works
websites file
include in classifieds file
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?camosreptiles.com.au\/ [NC]
RewriteRule \.(jpg|jpeg|png|gif)$ http://i14.photobucket.com/albums/a345/Instar/nedry2.gif [NC,R,L]
include in the forums file
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?camosreptiles.com.au/forum\/ [NC]
RewriteRule \.(jpg|jpeg|png|gif)$ http://i14.photobucket.com/albums/a345/Instar/nedry2.gif [NC,R,L]
These work and replace images AFTER clearing the cache. but regular visitors are not likely to have a clean cache (having visited the site before)
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?camosreptiles.com.au/classifieds\/ [NC]
RewriteRule \.(jpg|jpeg|png|gif)$ http://i14.photobucket.com/albums/a345/Instar/nedry2.gif [NC,R,L]
How do you stop them?
Also facebook has no trouble pulling thumbnails still, even without mention of them in the codes??? Mystery!
I still cannot get hotlinks to redirect to my policy page though! ?
EDIT: CRAP! now its not working again, WTF? I hate code!0
Answers
RewriteRule .*\.(gif|jpg|png|jpeg|bmp)$ http://www.camosreptiles.com.au/hotlink.shtml [R,NC]
also to include /forum & /classifieds
My forum file is... my classifieds file is I DID TRY adding to both forum and classifieds but it did not work !
onlu some. My front page images are protected, but not my gallery pics (which are just another page) ?? I dont understand this crap!
websites file include in classifieds file These work and replace images AFTER clearing the cache. but regular visitors are not likely to have a clean cache (having visited the site before)
How do you stop them?
Also facebook has no trouble pulling thumbnails still, even without mention of them in the codes??? Mystery!
I still cannot get hotlinks to redirect to my policy page though! ?
EDIT: CRAP! now its not working again, WTF? I hate code!
Is a conditional rewrite rule possible? for example:
If they do this..(anywhere but my domain)
<img src="http://www.mysite.com.au/mypic.gif"/>
They get a specific image instead, BUT..
If they do this....
<a href="http://www.mysite.com.au/mypic.gif"/><a great pic</a>
then when the link is clicked, it redirects to a specific page.
Thats what Id like to do, possible?
apache rewrite seems rather inflexable.