Forum Discussion
PeterC_70986
Nimbostratus
Apr 18, 2013Help with a redirect while changing a small part of the URI
I am trying to do a redirect which will look like below:
hostname.domain.com/abc/varying_remainder_uri redirect to NEWhostname.domain.com/def/varying_remainder_uri
I did the below which I...
Kevin_Stewart
Employee
Apr 18, 2013Let's try some logging then to verify if the iRule is producing what you want:
when HTTP_REQUEST {
log local0. "original URL = [HTTP::host][HTTP::uri]"
if { [HTTP::uri] starts_with "/abc/"} {
set newuri [string map {"/abc/" "/def/"} [string tolower [HTTP::uri]]]
log local0. "new URL = https://NEWhostname.domain.com$newuri"
HTTP::redirect "https://NEWhostname.domain.com$newuri"
}
}
Please report back what the logs return.
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