Forum Discussion
tvotta_94824
Nimbostratus
Oct 01, 2012Rewrite rule forward to specific domain and port
Hello Guys/Gals -- I'm new to irules and am trying to figure out a re-write scenario, I'm trying to change a current rule that does a redirect, and change it to rewrite. The current rule is lik...
hoolio
Cirrostratus
Oct 02, 2012Can you try this with additional debug logging? I assume you're on a pre-v11.0 release which had caching of many of the HTTP:: command values in the same iRule event.
when HTTP_REQUEST {
log local0. "[IP::client_addr]:[TCP::client_port]: [HTTP::method] to [HTTP::host][HTTP::uri]"
if { [HTTP::uri] equals "/" } {
log local0. "[IP::client_addr]:[TCP::client_port]: Rewriting / to /Portal/index.html"
HTTP::uri "/Portal/index.html"
}
HTTP::header replace Host "server.nbc-news.west.foo.com:7012"
}
when HTTP_REQUEST priority 501 {
Debug logging only--remove or comment out this event once testing is complete
log local0. "[IP::client_addr]:[TCP::client_port]: Updated host/uri: [HTTP::host][HTTP::uri]
}
when HTTP_RESPONSE {
log local0. "[IP::client_addr]:[TCP::client_port]: [HTTP::status] response from [LB::server]. Redirect location: [HTTP::header location]"
}
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
