Forum Discussion
Srinivasan_G_31
Jun 06, 2012Nimbostratus
GEO Based redirect
Friends,
I need help on getting an iRule that performs redirect to a specific web page based on client browser's country of access/GEO information. If the user accesses the website from Asia i want to detect that information from the HTTP packet and redirect it to the APAC webpage on the web-server. Can you help me out here. Thanks a lot.
Srini
- hooleylistCirrostratusHi Srinivasan,
- Srinivasan_G_31NimbostratusHi Aaron,
- Srinivasan_G_31NimbostratusHi Aaron,
- hooleylistCirrostratuswhereis is supported in 10.1 or higher for LTM. Here's an example of rewriting the URI based on the country code:
when CLIENT_ACCEPTED { Save the country code once per connection set cc [whereis [IP::client_addr] country] } when HTTP_REQUEST { Check if the cc is not empty if {$cc ne ""}{ Insert the country code in the requested URI HTTP::uri "/${cc}[HTTP::uri]" } }
- Richard__HarlanHistoric F5 AccountI would use a switch statement for the HTTP_REQUEST. That way you will not have to create a country web page for each country out there. With the switch statement you will add all the country's you have webpages for then send the rest to the default page what ever it is.
- Srinivasan_G_31NimbostratusThanks Richard. I would like to have a sample iRule that accomplishes this as i am no iRule expert. Can you help here?
- Srinivasan_G_31NimbostratusHi Aaron,
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects