Forum Discussion
TMaCEvans_92750
Nimbostratus
Jul 09, 2010301-302 redirect problem
currently due to a "quirk" of how a cms i'm using is setup I am left with a site with the following structure
www.mydomain.com -goes to pool A
www.mydomain.com/UK/ -goes to pool B
www.mydomain.com/USA/ -goes to pool C
www.mydomain.com/Asia/ -goes to pool D
also some content is hosted on the root domain
by default I would like people visiting www.mydomain.com to forward to
www.mydomain.com/UK/
we a currently doing this by www.mydomain.com send a 302 redirect to www.mydomain.com/UK/
I would like my f5 to redirect requests to www.mydomain.com to www.mydomain.com/UK/ with a 301
but leave requests to www.mydomain.com which are followed by a URI alone
redirecting www.mydomain.com requests strait to pool B without touching pool A
but still go to pool A if they request a URI other then /UK/,/USA/ or /Asia/
Regards
Brett
- hoolio
Cirrostratus
Hi Brett,when HTTP_REQUEST { log local0. "[IP::client_addr]:[TCP::client_port]: [HTTP::method] to [HTTP::host][HTTP::uri]" Check the requested URI with wildcard matching switch -glob [HTTP::uri] { "/" { Exact request for /, send 302 to /UK/ log local0. "[IP::client_addr]:[TCP::client_port]: Redirecting / to /UK/" HTTP::redirect "http://www.domain.com/UK/" } "/UK/*" { Request for a URI starting with /UK/ log local0. "[IP::client_addr]:[TCP::client_port]: Selecting pool_B" pool pool_B } "/USA/*" { Request for a URI starting with /USA/ log local0. "[IP::client_addr]:[TCP::client_port]: Selecting pool_C" pool pool_C } "/Asia/*" { Request for a URI starting with /Asia/ log local0. "[IP::client_addr]:[TCP::client_port]: Selecting pool_D" pool pool_D } default { Request for a URI starting with /Asia/ log local0. "[IP::client_addr]:[TCP::client_port]: Selecting pool_A by default" pool pool_A } } } when SERVER_CONNECTED { You can remove this event when done testing log local0. "[IP::client_addr]:[TCP::client_port]: selected pool: [LB::server], connected server: [IP::server_addr]:[TCP::server_port] }
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