Forum Discussion
WillC_97839
Nimbostratus
Nov 18, 2009Different pool, but need to pass the query string along
Hi there.
I tried doing a search and I found some stuff that kinda helps, but I'm not quite getting the results that I want.
I have a site, www.widgets.com
...
hoolio
Cirrostratus
Nov 18, 2009Do you want to preserve the entire query string or just one parameter? Do you need to rewrite the Host header value to widgets.search.com?
Here is an example which shows a few options. Note that you can "hide" the rewriting by not sending an HTTP redirect. The client won't see the change, assuming the web app does not use the rewritten URI in response headers or content it sends to the client.
when CLIENT_ACCEPTED {
Save the VIPs default pool name
set default_pool [LB::server pool]
}
when HTTP_REQUEST {
Check requested URI
switch -glob [HTTP::uri] {
"/widget-search/*" {
Request needs to go to second pool
pool widget_pool
Rewrite URI to /search/virtualsearch?q= with the original
value for the q parameter preserved
HTTP::uri "/search/virtualsearch?q=[URI::query [HTTP::uri] q]
Or...
Rewrite the URI to /search/virtualsearch with the original query string
HTTP::uri "/search/virtualsearch?[HTTP::query]
Rewrite the Host header to widgets.search.com
HTTP::header replace Host "widgets.search.com"
}
default {
Use the VIPs default pool
pool $default_pool
}
}
}
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
