Forum Discussion
iraheel_135195
Apr 14, 2014Nimbostratus
iRule Redirect isnt working
I am new to iRules , i want to set a redirect for my webapp. So when a user hits wcp.xx.com/wxx he is redirected to pushdev.xx.com/wxx & below is the iRule i have in place
when HTTP_REQUEST {
...
Cory_50405
Noctilucent
It isn't working because you are trying to compare the HTTP::host string to a full location (host + URI). Change your iRule to look like this:
when HTTP_REQUEST {
if {[string tolower [HTTP::host]] equals "wcp.xx.com" and [string tolower [HTTP::uri]] starts_with "/wxx" } {
HTTP::redirect "https://pushdev.xx.com/[HTTP::uri]"
}
}
iraheel_135195
Apr 15, 2014Nimbostratus
wow seems like i have to do some reading , is there any easier way ?
Can i simply use an else command with the code above
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