GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   anti-hotlink mod_rewrite question (https://gfy.com/showthread.php?t=360640)

Mr Pheer 09-22-2004 10:54 PM

anti-hotlink mod_rewrite question
 
How do i stop people from hotlinking images, but if they link to a page with an image, have that work?

in other words, linking to a page is fine, hotlinking just the image on the page is not

this is what I have:
RewriteEngine on
RewriteCond %{http_referer} !^$
RewriteCond %{http_referer} !^http://(www\.)?mydomain.com/.*$ [NC]
rewriterule ^.*$ http://www.mrpheer.com/bdc.gif [R,L]

but its blocking everything, pages and images

help?

Mr Pheer 09-22-2004 10:56 PM

fuckin hahah bullshit fucked up my code :(

johndoebob 09-22-2004 10:59 PM

If they hotlink images that will work.If you have images on single pages you need to redirect the referer.

Lycanthrope 09-22-2004 11:02 PM

Quote:

Originally posted by MrPheer
How do i stop people from hotlinking images, but if they link to a page with an image, have that work?

in other words, linking to a page is fine, hotlinking just the image on the page is not

this is what I have:
RewriteEngine on
RewriteCond %{http_referer} !^$
RewriteCond %{http_referer} !^http://(www\.)?mydomain.com/.*$ [NC]
rewriterule ^.*$ http://www.mrpheer.com/bdc.gif [R,L]

but its blocking everything, pages and images

help?

That's because you are telling it to redirect everything... do this:

RewriteEngine On
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?domain.com.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(www\.)?domain.com:80.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://ipaddress.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://ipaddress:80.*$ [NC]
RewriteRule .*[Jj][Pp][Gg]$|.*[Jj][Pp][Ee][Gg]$|.*[Gg][Ii][Ff]$ redirect.url [R,L]

Mr Pheer 09-22-2004 11:39 PM

having some problems because my gallery script doesnt serve the images as gif or jpg, it serves them like ?p000001111 or some other numbers


All times are GMT -7. The time now is 10:19 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123