Forum Discussion
Pandiarajan_701
Jun 26, 2012Nimbostratus
Irule Redirection
Dears,
I need to redirect an URL
www.bana.com/stp/* >>> www.gamil.com/*
We need to change the HTTP Host from "bana.com" to "gamil.com" and remove the "stp" from the URI and then keep whatever follows in the URI after the "stp"
Below is one of the Example:
http://www.bana.com/stp/stweb/index.jsp
should be redirected to
http://gamil.com/stwebclient/index.jsp
- hooleylistCirrostratusHi Pandiarajan,
when HTTP_REQUEST { if {[string tolower [HTTP::host][HTTP::uri]] starts_with "www.bana.com/stp/"}{ log local0. "[IP::client_addr]:[TCP::client_port]: Redirecting request to http://gamil.com[string range 4 end [HTTP::uri]" HTTP::redirect "http://gamil.com[string range 4 end [HTTP::uri]" } }
- Pandiarajan_701NimbostratusHi Aaron,
- nitassEmployeeyou are missing close bracket on HTTP::redirect line. it could be like this.
- Pandiarajan_701NimbostratusHi I will check this and update...
- nitassEmployeeHTTP::redirect will send redirection response to client. then, client will create a new connection to url which is specified in location header i.e. www.gamil.com/*. if you want this new connection to be directed to STP_Pool, the virtual server which handling www.gamil.com has to configure with STP_Pool.
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