Forum Discussion
Brad_Parker_139
Sep 23, 2015Nacreous
For a permanent redirect you would use this to do a 301:
when HTTP_REQUEST {
if { [string tolower [HTTP::host]] equals "www.abc.com" and [string tolower [HTTP::uri]] starts_with "/app/" } {
HTTP::respond 301 noserver Location "https://app.def.com/[string map {/app/ /} [string tolower [HTTP::uri]]]"
}
}
- SSellSep 23, 2015AltostratusAwesome, thank you.
- SSellSep 23, 2015AltostratusWe don't have anyway to test this until actual implementation. I was going to leave the question open until we implement and test which is scheduled for next Tuesday. Thanks for your help
- Brad_Parker_139Sep 23, 2015NacreousYou probably want to add string tolower to prevent case mis-match compares. I update above.
- SSellSep 23, 2015AltostratusThank you, I will add that. We setup a test F5 to play with. It's not a like for like comparison, but using wireshark we were able to see that it worked. We just had to make one small adjustment. I needed to remove the '/' at the end of the https://app.def.com/ when it mapped /app/ to / it made the url https://app.def.com// I will add the string tolower and test that as well. Thanks for your help
- SSellSep 29, 2015AltostratusWorked flawlessly. Thank you