Forum Discussion
ukitsysadmin_95
Nimbostratus
Nov 10, 2009replace http::host headers
Is it possible to do the following
when HTTP_REQUEST {
if { [HTTP::host] starts_with "preview.www."} {
I want to redirect to
HTTP::redirect "htt...
hoolio
Cirrostratus
Nov 10, 2009Actually, the domain command won't work for this scenario if you need to support example.com and example.co.uk...
How about this instead:
when HTTP_REQUEST {
log local0. "[IP::client_addr]:[TCP::client_port]: New [HTTP::method] request to [HTTP::host][HTTP::uri]"
if { [string tolower [HTTP::host]] starts_with "preview.www."} {
log local0. "[IP::client_addr]:[TCP::client_port]: Redirecting to preview2.www.[getfield [string tolower [HTTP::host]] preview.www. 2]"
HTTP::redirect "http://preview2.www.[getfield [string tolower [HTTP::host]] preview.www. 2]"
}
}
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
