Forum Discussion
Tom_90789
Nimbostratus
Jul 17, 2009Change part of HTTP::host based on User Agent
I am trying to change the HTTP:host for a HTTP::redirect based on the UserAgent identified.
I am able to make it work using a static host, and changing to a different static host, base on the U...
The_Bhattman
Nimbostratus
Jul 19, 2009I am assuming that useragent_list contains the list of mobile user-agents.
The following might be a simpler way to approach it.
when HTTP_REQUEST {
if { ([HTTP::host] equals "www.domain.com" ) and ([HTTP:uri] equals "someuri/goeshere") } {
if { [matchclass [HTTP::header "User-Agent"] contains $::useragent_list ] } {
HTTP::redirect "http://m.mobile.com[HTTP::uri]"
} else {
HTTP::redirect "http://www2.domain.com[HTTP::uri]"
}
}
}
Hope this helps
CB
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