Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 01-04-2003, 10:04 AM   #1
G Sharp
So Fucking Banned
 
Join Date: May 2002
Posts: 1,343
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
G Sharp is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-04-2003, 10:08 AM   #2
LukieD
Confirmed User
 
Join Date: Dec 2001
Location: London
Posts: 927
Just put:

deny from domain.com

in .htaccess
LukieD is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-04-2003, 10:09 AM   #3
LukieD
Confirmed User
 
Join Date: Dec 2001
Location: London
Posts: 927
http://www.htmlbasix.com/disablehotlinking.shtml
LukieD is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-04-2003, 10:09 AM   #4
G Sharp
So Fucking Banned
 
Join Date: May 2002
Posts: 1,343
Quote:
Originally posted by LukieD
Just put:

deny from domain.com

in .htaccess
Mind sharing the whole code?

Much appreciated,

G
G Sharp is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-04-2003, 10:11 AM   #5
G Sharp
So Fucking Banned
 
Join Date: May 2002
Posts: 1,343
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 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-04-2003, 10:58 AM   #6
G Sharp
So Fucking Banned
 
Join Date: May 2002
Posts: 1,343
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
G Sharp is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-04-2003, 11:17 AM   #7
directfiesta
Too lazy to set a custom title
 
directfiesta's Avatar
 
Industry Role:
Join Date: Oct 2002
Location: Punta Cana, DR
Posts: 29,592
can also deny one IP or adress in Apache config file
directfiesta is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-04-2003, 11:23 AM   #8
G Sharp
So Fucking Banned
 
Join Date: May 2002
Posts: 1,343
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?
G Sharp is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-04-2003, 11:28 AM   #9
stevo
Confirmed User
 
Join Date: Aug 2002
Location: Orlando, Florida
Posts: 2,051
Im not sure if this works...
RewriteCond %{HTTP_REFERER} ^http://.*hotlinker.com.*$ [OR]
RewriteRule .[Jj][Pp][Gg]*$ http://yoursponsor.com [L]
stevo is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-04-2003, 11:43 AM   #10
G Sharp
So Fucking Banned
 
Join Date: May 2002
Posts: 1,343
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?
G Sharp is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-04-2003, 11:57 AM   #11
directfiesta
Too lazy to set a custom title
 
directfiesta's Avatar
 
Industry Role:
Join Date: Oct 2002
Location: Punta Cana, DR
Posts: 29,592
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....
directfiesta is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-04-2003, 12:06 PM   #12
G Sharp
So Fucking Banned
 
Join Date: May 2002
Posts: 1,343
SteveO, DirectFiesta, Luke,

Thanks for the help. I fixed the problem.

G Sharp
G Sharp is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.