12-14-2010 09:09 AM
I have a customer that wants to redirect incoming traffic to a different url or host based on the end users language. Spanish in particular. What is the best way to accomplish this task with the least amount of issues.
Stan
12-14-2010 10:39 AM
You will need to check if the http request contains a heade specifying the user is using spanish.
Seems like the only way.
You can use an http class-map to match traffic that has the spanish header value.
Gilles.
12-14-2010 10:43 AM
Can I find any sample code anywhere? I have never had to do this before
for a different language.
12-15-2010 12:08 AM
If you capture a sniffer trace of any HTTP traffic, you will see that every request contains a line like this :
"Accept-Language: de"
So, in this example the request contains information that the browser accept German (DE).
If you sniff a request from a spanish browser, you should see a similar line with the "SP" letters.
Then with ACE, you can match those requests with a class-map like below :
AceC6k2/Admin(config)# class-map type http load Spanish
AceC6k2/Admin(config-cmap-http-lb)# match http heade Accept-Language header-value sp
AceC6k2/Admin(config-cmap-http-lb)#
Then inside your policy-map you can use this class-map to differentiate spanish request from the others.
policy-map type
AceC6k2/Admin(config)# policy-map type loadbalance http first-match Web
AceC6k2/Admin(config-pmap-lb)#
AceC6k2/Admin(config-pmap-lb)# class-map Spanish
<.....do something here for spanish browsers .....>
AceC6k2/Admin(config-pmap-lb)# class class-default
<..... do something here for the other browsers ......>
gilles.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide