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)
-   -   htaccess antihotlinking question (https://gfy.com/showthread.php?t=745714)

Wolfy 06-24-2007 07:20 PM

htaccess antihotlinking question
 
(I don't want to disable hotlinking completely.)

You can block individual sites by using this:

RewriteCond %{HTTP_REFERER} ^http://(.+\.)?site\.com/ [NC]

such as:

RewriteCond %{HTTP_REFERER} ^http://(.+\.)?fusker\.lv/ [NC]



but what if I want to block every site that has the text "fusker" anywhere in the url? How do I do that?

Wolfy 06-24-2007 07:48 PM

come on, one of you knows this info. :D

Wolfy 06-24-2007 08:20 PM

one of yous sales short solutions :D

jonesonyou 06-24-2007 08:22 PM

did you ask google? I have no clue. good luck .

Wolfy 06-24-2007 08:47 PM

+1 to your postcount though, good job! (thanks for the bump :))

footmonkey 06-24-2007 11:01 PM

Quote:

Originally Posted by Wolfy (Post 12652458)
(I don't want to disable hotlinking completely.)

You can block individual sites by using this:

RewriteCond %{HTTP_REFERER} ^http://(.+\.)?site\.com/ [NC]

such as:

RewriteCond %{HTTP_REFERER} ^http://(.+\.)?fusker\.lv/ [NC]



but what if I want to block every site that has the text "fusker" anywhere in the url? How do I do that?

Try this...
RewriteCond %{HTTP_REFERER} !^www\.mysite\.com
RewriteCond %{HTTP_REFERER} !^$

1) says only allow referrers that are your own site
2) says don't block if there's no referrer

Hope it helps

darksoul 06-25-2007 12:37 AM

Code:

RewriteCond %{HTTP_REFERER} ^.*fusker.*$ [NC]

Wolfy 06-25-2007 04:47 AM

Quote:

Originally Posted by darksoul (Post 12653473)
Code:

RewriteCond %{HTTP_REFERER} ^.*fusker.*$ [NC]


hmmm... just tried it, that didn't work for (example: http://www.milkonya.com/fusker/index.php?lid=36173)

darksoul 06-25-2007 04:52 AM

Quote:

Originally Posted by Wolfy (Post 12654084)
hmmm... just tried it, that didn't work for (example: http://www.milkonya.com/fusker/index.php?lid=36173)

I assume your .htaccess is complete ?
ie:
Code:

RewriteEngine On
RewriteCond %{HTTP_REFERER} ^.*fusker.*$ [NC]
RewriteRule .*\.(gif|jpg|png) - [F]

should work

Wolfy 06-25-2007 05:11 AM

Code:

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{HTTP_REFERER} ^http://(.+\.)?forum\.phun\.org/ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http://(.+\.)?sexonabanheira\.com/ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http://(.+\.)?photos\.boobdex\.com/ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http://(.+\.)?blogspot\.com/ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http://(.+\.)?livejournal\.com/ [NC]
RewriteCond %{HTTP_REFERER} ^http://(.+\.)?roberc\.lv/ [NC]
RewriteCond %{HTTP_REFERER} ^http://(.+\.)?fuskerxp\.com/ [NC]
RewriteCond %{HTTP_REFERER} ^http://(.+\.)?midnitecrowproductions\.com/ [NC]
RewriteCond %{HTTP_REFERER} ^http://(.+\.)?fusker\.?/ [NC]
RewriteRule .*\.(jpe?g|gif|bmp|png)$ /images/nohotlink.jpe [L]


darksoul 06-25-2007 05:12 AM

oh,
all RewriteCond's except the last one need to have
[NC,OR]

darksoul 06-25-2007 05:17 AM

also the fusker rule needs another match-anything at the end
^http://(.+\.)?fusker\..*$ [NC]

Wolfy 06-25-2007 05:29 AM

so...


Code:

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{HTTP_REFERER} ^http://(.+\.)?forum\.phun\.org/ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http://(.+\.)?sexonabanheira\.com/ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http://(.+\.)?photos\.boobdex\.com/ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http://(.+\.)?blogspot\.com/ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http://(.+\.)?livejournal\.com/ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http://(.+\.)?roberc\.lv/ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http://(.+\.)?fuskerxp\.com/ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http://(.+\.)?midnitecrowproductions\.com/ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http://(.+\.)?fusker\..*$ [NC]
RewriteRule .*\.(jpe?g|gif|bmp|png)$ /images/nohotlink.jpe [L]

like that??

darksoul 06-25-2007 05:43 AM

yes,
and remove the first condition REQUEST_FILENAME ...

Wolfy 06-25-2007 03:04 PM

fuck, now it's disabled hotlinking completely.

SCORE Ralph 06-25-2007 03:30 PM

Quote:

Originally Posted by Wolfy (Post 12657543)
fuck, now it's disabled hotlinking completely.

lol... man i was going to see if i could help but it seems you already tried all I was going to mention.

GL

Wolfy 06-25-2007 07:06 PM

appreciate the bump just the same bro :)

kimzar 06-25-2007 08:46 PM

bump!:pimp


All times are GMT -7. The time now is 07:12 AM.

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