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 06-11-2002, 07:47 AM   #1
BabeHunter
Webmaster
 
BabeHunter's Avatar
 
Industry Role:
Join Date: Oct 2001
Location: 2nd door on the left
Posts: 4,063
htaccess expert needed...

I need an htaccess file that redirects visitors based on ip blocks...
for example i have all the ip blocks for japan...and i want to redirect them all to an ad page...
can you do it?
contact me at [email protected]
let me know...if it do what i need i'm willing to pay...hehe
__________________
Yep
BabeHunter is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-11-2002, 07:56 AM   #2
zubr
Confirmed User
 
Join Date: Jan 2002
Location: Toronto
Posts: 1,227
Add the following to the .htaccess file:

< Limit GET >
order allow,deny
deny from .jp
allow from all
< /Limit >

ErrorDocument 403 http://japanese-popup-hell.com

--------------------------------------
Remove unnecessary spaces, otherwise part of the code wouldnt show up
__________________
Alex - ICQ:61889253 - MSN:zubr_zubr at hotmail.com - Skype:zubrzubr

Last edited by zubr; 06-11-2002 at 07:57 AM..
zubr is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-11-2002, 07:58 AM   #3
BabeHunter
Webmaster
 
BabeHunter's Avatar
 
Industry Role:
Join Date: Oct 2001
Location: 2nd door on the left
Posts: 4,063
Quote:
Originally posted by zubr
Add the following to the .htaccess file:

<Limit GET>
order allow,deny
deny from .jp
allow from all
</Limit>

ErrorDocument 403 http://japanese-popup-hell.com
thanks man...but does it mean that only the ppl the come from domain.jp will be redirected? what about a japanese surfer that comes from domain.com?
__________________
Yep
BabeHunter is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-11-2002, 08:37 AM   #4
Rocco
Registered User
 
Join Date: May 2002
Posts: 30
Yes probably the surfer too....

But why you don't block each IP Instead of a large IPS?

Rocco
Rocco is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-11-2002, 09:28 AM   #5
salsbury
Confirmed User
 
Join Date: Feb 2002
Location: Seattle
Posts: 1,070
here's what i've got. it's a freebie, 'cause salsbury's a nice guy. (and 'cause i don't know if it'll work perfectly as-is. ;))

just a word of advice: using deny or allow with any type of hostname will force hostnamelookups on, which will slow down your surfer's experience. ie it's not so good.

create a file called "punklist.txt" in your site's root directory. add IP blocks and URLs to the file as so:

192.168.0 http://www.someblindlinksponsor.com/
127.0.0 http://www.whitehouse.gov/

etc. basically it expects to have the first 3 octets there. next, add the following to your httpd.conf file in your VirtualHost directive:

RewriteMap punk-o txt:/path/to/server/root/punklist.txt
RewriteCond %{REMOTE_ADDR} ^([0-9]*\.[0-9]*\.[0-9]*)\.[0-9]*
RewriteCond ${punk-o:%1|OK-TO-PASS} !=OK-TO-PASS
RewriteRule ^/.* ${punk-o:%1} [R,L]

unfortunately it won't work in the .htaccess file for whatever reason, silly apache.

if you'd like an explanation of all this, hit me for e-mail [email protected] . holy crap that took a lot longer to figure out than i expected. but it does indeed work.
__________________
salsbury is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-11-2002, 09:34 AM   #6
BabeHunter
Webmaster
 
BabeHunter's Avatar
 
Industry Role:
Join Date: Oct 2001
Location: 2nd door on the left
Posts: 4,063
Quote:
Originally posted by salsbury
here's what i've got. it's a freebie, 'cause salsbury's a nice guy. (and 'cause i don't know if it'll work perfectly as-is. ;))

just a word of advice: using deny or allow with any type of hostname will force hostnamelookups on, which will slow down your surfer's experience. ie it's not so good.

create a file called "punklist.txt" in your site's root directory. add IP blocks and URLs to the file as so:

192.168.0 http://www.someblindlinksponsor.com/
127.0.0 http://www.whitehouse.gov/

etc. basically it expects to have the first 3 octets there. next, add the following to your httpd.conf file in your VirtualHost directive:

RewriteMap punk-o txt:/path/to/server/root/punklist.txt
RewriteCond %{REMOTE_ADDR} ^([0-9]*\.[0-9]*\.[0-9]*)\.[0-9]*
RewriteCond ${punk-o:%1|OK-TO-PASS} !=OK-TO-PASS
RewriteRule ^/.* ${punk-o:%1} [R,L]

unfortunately it won't work in the .htaccess file for whatever reason, silly apache.

if you'd like an explanation of all this, hit me for e-mail [email protected] . holy crap that took a lot longer to figure out than i expected. but it does indeed work.
Thanks man...but...the ip list that i have...is REALLY long...it will take days to write it...hehe
but thanks anyways
__________________
Yep
BabeHunter is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-11-2002, 09:36 AM   #7
salsbury
Confirmed User
 
Join Date: Feb 2002
Location: Seattle
Posts: 1,070
np. however it probably wouldn't be too hard to set up the list with a good text editor like vi. in any case good luck.
__________________
salsbury is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-11-2002, 09:45 AM   #8
fiveyes
Confirmed User
 
Join Date: Aug 2001
Location: New Orleans
Posts: 1,680
Mmm, challenging, that. I love it!

Let's see,

order deny,allow

# Deny from a specific IP number
deny from 123.45.67.89

# Deny from 123.45.6.0 - 123.45.6.255
deny from 123.45.6

# Deny from 123.45.6.34 - 123.45.6.46
deny from 123.45.6.32/28

...

The last one, using netmasks, is the brain cruncher!

See http://httpd.apache.org/docs/mod/mod_access.html#allow
http://www.darklab.net/resources/netmask.html
http://metronet.min.net/Netmasks
http://handsonhowto.com/lan101.html
for what's needed...
__________________
<CENTER><A HREF="http://www.hot-off-bourbon.com/" target="_blank"><IMG SRC="http://www.hot-off-bourbon.com/images/hob-logosmall.jpg" border="0"></A>

<FONT face="Comic Sans MS" SIZE="-1"><I>Mardi Gras, Spring Break, Wet-T, Night Club Action, UpSkirt, Oil Wrestling, Voyeur</I></FONT></CENTER>
fiveyes is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-11-2002, 10:40 AM   #9
BabeHunter
Webmaster
 
BabeHunter's Avatar
 
Industry Role:
Join Date: Oct 2001
Location: 2nd door on the left
Posts: 4,063
Thanks guys
__________________
Yep
BabeHunter is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-11-2002, 05:12 PM   #10
vegasdude
Confirmed User
 
Join Date: Jul 2001
Location: The Royal Family Crew
Posts: 3,649
I hate htaccess!!!
vegasdude 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.