Roger_Oliver_78
Jul 24, 2007Nimbostratus
More Custom WAP Irules
I first want to thank everyone that has done WAP before. I liked the Irules I saw and got most of them to work in my test. However I have a problem some of the newer phones do not allow multiple redirects and I'm running into a crunch.
This is a sample of the code that my "WAP content" provider wants me to use to do the redirection based on the phone. This is not an irule of course but I have to find a way to make it an irule. My site went pure Ruby on Rails so I'm kinda in a bind.
The problem is they need me to point different phones to different "http://wap.vendor.com/partnergenericURL"
<% String accept = request.getHeader("accept");
if (accept != null) {
int i = accept.indexOf("wap");
int j = accept.indexOf("vnd.wap.xhtml+xml");
if (i > 0 || j > 0)
response.sendRedirect("http://wap.vendor.com/partnergenericURL");
else
//display partner homepage page normally
} else {
// display partner homepage page normally
}
%>
I forgot to add this. This is my current Irule based on the WAP irules I have found here on the site. What they are "saying" is that Nextel and some other vendor do not allow more then one redirect.
----
when HTTP_REQUEST {
switch -glob [HTTP::header User-Agent] {
"*Java/1.4.1_02*" -
"*Blazer*" -
"*blazer*" -
"*palm*" -
"*Palm*" -
"*SMARTPHONE*" -
"*Smartphone*" -
"*smartphone*" -
"*MOT-*" -
"*RAZR*" -
"*AUDIOVOX*" -
"*Symbian*" -
"*symbian*" -
"*NOKIA*" -
"*Nokia*" -
"*Sony Ericsson*" -
"*Samsung*" -
"*LG 8*" -
"*Alcatel 735i*" -
"*Nextel*" -
"*Windows CE*" -
"*BlackBerry*" -
"*Blackberry*" -
"*NetFront*" {
HTTP::redirect "http://wap.vendor.com/foo"
return
}
}
switch -glob [HTTP::header Accept] {
"*text/vnd.wap.wml*" -
"*text/vnd.rim.html*" {
HTTP::redirect "http://wap.vendor.com/foo/wmlfeed"
return
}
}
switch -glob [HTTP::header User-Agent] {
"*hiptop*" -
"*AvantGo*" -
"*Danger*" {
HTTP::redirect "http://wap2.vendor.com/foo/xmlfeed"
return
}
}
----
Thank you all for your help and input. I'm going to continue to search the forums