Forum Discussion

Squeak_117117's avatar
Squeak_117117
Icon for Nimbostratus rankNimbostratus
Feb 05, 2019

Portal access redirect based on on device type.

Hi,

I´ve some issues with doing a redirect based on device type.

My setup looks like this:

We are using a webtop to publish some Portal access resources for both desktop browsers and for mobile devices. My issue are that the mobile devices should be redirected to a different uri then the desktop users. If a desktop user clicks on a Portal access resource the base uri are /asdf but when mobile device user clicks it should be /qwerrtt

I´ve tried to do this with an irule but without success.

All help are appreciated.

  when HTTP_REQUEST {
  set wtType [ACCESS::session data get session.policy.result.webtop.type]
  if {[ info exists wtType ] && $wtType == "full" } {
    if { !([HTTP::uri] starts_with "/f5-w-*masked Value/") &&  [HTTP::header User-Agent] equals "*android*" && [HTTP::uri] contains "/asdf"  }  {  
       HTTP::redirect "/f5-w-70616c657474652e706561622e7365$$/qwerrtt"

    }
  }
  unset wtType
}
No RepliesBe the first to reply