Forum Discussion
MSK_222682
Nimbostratus
Feb 04, 2016URL redirection with retaining the original on browsers
Hi All,
I have a requirement whereby the user would try to access www.test.com but it needs to be redirected to www.test.abc.com, which is hosted in our environment.
Business doesn't want to publ...
Minn_62043
Cirrostratus
Feb 04, 2016Are trying to convert the links inside the HTTP response from www.abc.test.com to www.test.com again?
You can create a new stream profile to translate the domain names or use an iRule like this:
when HTTP_REQUEST {
set to_change 0
if { [HTTP::path] contains "/urltomonitor" } {
set to_change 1
}
STREAM::disable
}
when HTTP_RESPONSE {
if { $to_change == 1} {
set original "http://www.abc.test.com"
set replacement "http://www.test.com"
STREAM::expression "@$original@$replacement@"
STREAM::enable
}
}
You will need to modify the [HTTP::path] to match your url that contains redirection, and you still need to attach "stream" profile to your virtual server.
Minn_62043
Cirrostratus
Feb 04, 2016So if a user is going to this url http://www.test.com/urltomonitor, and the page is redirecting the user to http://www.abc.test.com or if the page contains http://www.abc.test.com, iRule will replace that domain with http://www.test.com before sending the response to user, and user browser will never get to see www.abc.test.com.
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