Hi, I want to show different things to different viewers based on their IP addresses. How can I do this? Cheers, David
--On 7. Januar 2008 08:00:27 -0600 David Chelimsky <dchelimsky@gmail.com> wrote:
Hi,
I want to show different things to different viewers based on their IP addresses. How can I do this?
Basically you look at the clients ip address (from the REQUEST object) and perform any action you need (redirections, conditions within scripts, templates)...but no idea what the sense of this usecase is. If you have different audiences, setup sites with different content or something similar. In addition: using Zope behind proxy will lead in request coming from the IP address of your reverse proxy. Additional configuration/programming is necessary to get hold of the original IP. -aj
On Jan 7, 2008, at 9:00 AM, David Chelimsky wrote:
Hi,
I want to show different things to different viewers based on their IP addresses. How can I do this?
Cheers, David
swap out "theipaddress" with the actual IP. <dtml-if "REMOTE_ADDR == 'theipaddress'"> true <dtml-elif "HTTP_X_FORWARDED_FOR == 'theipaddress'"> true <dtml-else> false </dtml-if> Tom
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
participants (3)
-
Andreas Jung -
David Chelimsky -
Tom Von Lahndorff