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)
-   -   How to block A DOMAIN using .htaccess (https://gfy.com/showthread.php?t=97821)

G Sharp 01-04-2003 10:04 AM

How to block A DOMAIN using .htaccess
 
Some jackasses from just 1 domain hotlink my pics. I'd like to know how to set up .htaccess to block just this domain. I get traffic from many sources so typical .htaccess setup of listing domains to access won't work. I just need to block 1 domain.

Any help would be greatly appreciated.

Thanks,

G

LukieD 01-04-2003 10:08 AM

Just put:

deny from domain.com

in .htaccess

LukieD 01-04-2003 10:09 AM

http://www.htmlbasix.com/disablehotlinking.shtml

G Sharp 01-04-2003 10:09 AM

Quote:

Originally posted by LukieD
Just put:

deny from domain.com

in .htaccess

Mind sharing the whole code?

Much appreciated,

G

G Sharp 01-04-2003 10:11 AM

Quote:

Originally posted by LukieD
http://www.htmlbasix.com/disablehotlinking.shtml
Tried it but the generator only generates code that lists domains that are ALLOWED to view the image.

I'd like to just DENY one IP/domain

G Sharp 01-04-2003 10:58 AM

I guess what I need is .htaccess code that ALLOWS HOTLINKING but BLOCKS only the referrers I listed in the .htaccess file.

Can this be done? I allow my users to hotlink but there's just 1 forum site that is out of control!

Any help would be appreciated,

G

directfiesta 01-04-2003 11:17 AM

can also deny one IP or adress in Apache config file

G Sharp 01-04-2003 11:23 AM

Quote:

Originally posted by directfiesta
can also deny one IP or adress in Apache config file
Thanks direct, can you share the code for this? Also, what's the name of the file to modify?

stevo 01-04-2003 11:28 AM

Im not sure if this works...
RewriteCond %{HTTP_REFERER} ^http://.*hotlinker.com.*$ [OR]
RewriteRule .[Jj][Pp][Gg]*$ http://yoursponsor.com [L]

G Sharp 01-04-2003 11:43 AM

Quote:

Originally posted by stevo
Im not sure if this works...
RewriteCond %{HTTP_REFERER} ^http://.*hotlinker.com.*$ [OR]
RewriteRule .[Jj][Pp][Gg]*$ http://yoursponsor.com [L]

Didn't work... The hotlinkers are using an IP address

so I used the following:

RewriteEngine on
RewriteCond %{HTTP_REFERER} ^http://IPADDRESS.*$ [OR]
RewriteRule .[Jj][Pp][Gg]*$ http://mysponsor.com [L]

Am I doing it right?

directfiesta 01-04-2003 11:57 AM

Quote:

Originally posted by G Sharp


Thanks direct, can you share the code for this? Also, what's the name of the file to modify?

in the conf folder, a file called httpd. BACK IT UP to http,old before doing any changes!!!!

In that file opened with NOTEPAD, you will see the following:
....
#
# Controls who can get stuff from this server.
#
Order allow,deny
Allow from all
</Directory>
.......

change that to:

#
# Controls who can get stuff from this server.
#
Order allow,deny
Allow from all
deny 216.111.154.112
deny www.asshole.com
deny asshole.com
</Directory>

Save the file by selecting in notepad the proper original file, then writing over. Restart Apache.

If Apache fails, you have an error. The backup file is then very welcomed....

G Sharp 01-04-2003 12:06 PM

SteveO, DirectFiesta, Luke,

Thanks for the help. I fixed the problem.

G Sharp


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

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