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...
Kevin_Stewart
Employee
Oct 01, 2012You shouldn't need to specify the port unless the application requires it. It's rare but some do. So instead of redirecting on host, you want to silently modify the host header for ingress traffic. You'll definitely need a pool with port 7012 members and modify the host header on every request. The URI change from "/" to "/Portal/index.html" should probably be a redirect though - unless you want to be in the business of managing every possible URI (the work of a rewrite proxy).
when HTTP_REQUEST {
if { [HTTP::uri] equals "/" } {
HTTP::redirect "/Portal/index.html"
} else {
HTTP::header replace Host "server.nbc-news.west.foo.com"
}
}
Again, should you need to completely hide the URI as well, you can use the HTTP::uri command on the ingress, but you have to be mindful of any possible URI translations.
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
