Operating System - HP-UX
1834222 Members
2429 Online
110066 Solutions
New Discussion

Redirect based on IP Address

 
Erick T. Mitchell
Occasional Contributor

Redirect based on IP Address

Experts,
I need to a method of redirecting a user based on the ip_address they use to access the URL.

example: if they access the www.first.com with 111.111.111.111 they would be redirected to www.second.com and if possible set a ip range of redirection.
What's the best method ?
7 REPLIES 7
Biswajit Tripathy
Honored Contributor

Re: Redirect based on IP Address

See IPFilter NAT redirect feature does what you want:
http://docs.hp.com/en/B9901-90021/ch02s04.html

- Biswajit
:-)
Erick T. Mitchell
Occasional Contributor

Re: Redirect based on IP Address

This site has some good information but I would like to use the method of modifing the http.conf(if this is an option )

http://docs.hp.com/en/B9901-90021/ch02s04.html
Thanks for the info it, this be something I look into going foward.
E
Mel Burslan
Honored Contributor

Re: Redirect based on IP Address

I am not an expert on apache but having seen few examples of httpd.conf files, I think you need to look into virtual servers and URL re-write options. How to do it I am not sure as it is not my expertise, but all of the cheap hosting operations, depend on the virtual server idea, i.e. running a multi URL system on a single IP address.

Sorry I could not be more specific.
________________________________
UNIX because I majored in cryptology...
Erick T. Mitchell
Occasional Contributor

Re: Redirect based on IP Address

Thanks I'm working on the option now but need a little more background information for the conf...

current www ???
redirect new www ???



Mel Burslan
Honored Contributor

Re: Redirect based on IP Address

well, my site is colocated on a server managed by a close friend of mine, so I was able to gain root access and disect the httpd.conf file

here's how my virtual server directive looks like:


ServerName my123site.net
ServerAdmin admin@my123site.net
DocumentRoot /var/www/html/my123site
ServerAlias www.my123site.net
ErrorLog logs/my123site.net-error_log
CustomLog logs/my123site.net-access.log combined


where my123site.net is the actual name of my domain and a.b.c.d is the IP address of the single host servin multiple domains.

for each domain, we have a similar virtual host directive.

Hope this helps
________________________________
UNIX because I majored in cryptology...
Erick T. Mitchell
Occasional Contributor

Re: Redirect based on IP Address

I was successful in adding a VirtualHost but I still need some more information on IP ranges....There are over 300 ip address that I need to redirect...

E
Nguyen Anh Tien
Honored Contributor

Re: Redirect based on IP Address

I think there are at least 3 solutions:
Firt: Using DNS
Second: Using Vitual Host
Third: Using IPtables
Recommend: Uing IPtables (www.iptables.org) this program is best for security. It support TCP/IP not only one port (Vitual host support only for Web).
HP is simple