Forum Discussion
harton
Nimbostratus
Aug 22, 2011Common URI
I have a situation where I have a common portal for various customers. Customer A uses www.xyz.com/customerA and customer B uses www.xyz.com/customerB etc. The LTM directs the customers to their ow...
hoolio
Cirrostratus
Aug 22, 2011Hi Harton,
How about setting a cookie if a request comes to a URI starting with /customerA or /customerB indicating which customer the user is and then referencing that in subsequent requests which aren't to a customerA or customerB URI?
when HTTP_REQUEST {
Check if this is a customerA or customerB request
switch -glob [HTTP::path] {
"/customerA*" {
set cust "customerA"
pool customerA_pool
}
"/customerB*" {
set cust "customerB"
pool customerB_pool
}
default {
Check if there is a cookie indicating which customer this is
switch [HTTP::cookie customer] {
"customerA" {
pool customerA_pool
}
"customerB" {
pool customerB_pool
}
default {
Specify a default pool name to use here
pool default_pool
Unset the customer variable
if {[info exists cust]}{ unset cust }
}
}
}
}
}
when HTTP_RESPONSE {
Set a cookie if we know which customer this is
if {[info exists cust]}{
switch $cust {
"customerA" {
HTTP::cookie insert customer name "customerA" path "/"
}
"customerB" {
HTTP::cookie insert customer name "customerB" path "/"
}
}
}
}
Aaron
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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