🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: chile.comp.programacion
Article #1109

redirect por rango de IP en php?

#1109
From: Christian Szita
Date: Thu, 18 Jan 2007 00:26
31 lines
1537 bytes
Donde puedo encontrar un script en php que pueda hacer un HTTP redirect a
distintas p�ginas o sitios segun rango de IP?

Me explico: Si una m�quina con IP 190.x.x.x. llama al index.php, este busca
dentro de una tabla si la IP del cliente est� dentro de un rango, caso en el
cual lo manda a una p�gina definida.
Tanto para rangos como para IP's individuales. Si no esta en la lista, cae
en default

algo como

case IP 201.x.x.x
  redirect to www.domain.tld/page1.html

case IP 200.0.0.0 to 201.255.255.254
    redirect to domain.tld/pagex.html

case IP 164.22.150.1
   redirect to domain.tld/page2.html

default:
  redirect to domain.tld/default.html

Gracias :-)


-- 
There's no place like 127.0.0.1
Site: http://szita.net
Blog: http://szita.net/blog
Flickr: http://sz.cl/flickr
Technical Details
Message-ID: <517t6bF1jdae9U1@mid.individual.net>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 1593cb,e960365bf286b6d,start
X-Google-Attributes: gid1593cb,public
X-Google-Language: SPANISH,ASCII
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: "Christian Szita" <christian@deadspam.com>
Newsgroups: chile.comp.programacion
Subject: redirect por rango de IP en php?
Date: Wed, 17 Jan 2007 21:26:43 -0300
Lines: 37
Message-ID: <517t6bF1jdae9U1@mid.individual.net>
X-Trace: individual.net q4BlzGR6Pw4avwdo6ICtRABetum2O/eeB+ikbxvVOfhZ5VMiuX
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028