Forum Discussion
hamishhound_199
Nimbostratus
Apr 29, 2015iRule redirect
I would like to do the following redirect via an iRule.
Redirect * to *
I have created the following iRule and added to the VS resources but it does not work. Any help would be appreciated as I am a total novice here!
when HTTP_REQUEST { if { [HTTP::host] starts_with "ensemble-sp1/" && [HTTP::uri] contains "/sites/PMIS/*"} {
HTTP::redirect "http://cindy-uat/*[HTTP::uri]"
} }
1 Reply
You can try something like this:
when HTTP_REQUEST { if { ([string tolower [HTTP::host]] starts_with "ensemble-sp1") && ([string tolower [HTTP::uri]] contains "/sites/PMIS/" ) } { the following command will find the string /sites/PMIS/ and will return all characters after that string until it hits either an & or the end of the string, HTTP::redirect "http://cindy-uat/[findstr [HTTP::uri] "/sites/PMIS/" 12 &]" } }I haven't actually tested this, but it should be a good starting point for you.
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