Forum Discussion
kevin_hendricks
Nimbostratus
Feb 06, 2009rewrite address bar in browser
Hi All,
I'm new to the world of irules and am trying to find something that will change the url in the address bar on the endusers browser.
so,, when they go to "aaa.myzone.com" I want t...
Feb 06, 2009
In the future, if you could post these types of questions to the iRules forum, then, you'll likey get a quicker response.
There are two types if url rewrites you can do with iRules. First a HTTP::redirect will issue a redirect HTTP response back to the browser. The browser will then in turn change the address bar and issue a new request. The following example will look for host requests to aaa.myzone.com and will issue a redirect to the browser keeping the URI intact but changing the host.
when HTTP_REQUEST {
switch [HTTP::host] {
"aaa.myzone.com" {
HTTP::redirect "http://bbb.mynewzone.com[HTTP::uri]"
}
}
}
Or, if you don't want to change the address bar, you can just modify the host value, you can do so with the following code
when HTTP_REQUEST {
switch [HTTP::host] {
"aaa.myzone.com" {
HTTP::header replace "Host" "bbb.mynewzone.com"
}
}
}
Hope this helps...
-Joe
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
