Forum Discussion
Redirection multiple URLS
- Nov 13, 2013
I would just do the switch statment and not the switch and the if statment. The redirects in the if statments should not be https://https. The problem with the switch statment is you are doing a string tolower but then are matching on a string with Caps. It would also be good in troubleshooting to add a log statement showing what you are matching.
when HTTP_REQUEST { set RequestedPath [string tolower [HTTP::path]] log local0. "RequestedPath = $Requestedpath" switch $RequestedPath { "/gowest" { HTTP::redirect "https://www.y.com/GoWest" } "/gosouth" { HTTP::redirect "https://www.y.com/GoSouth" } } }
If you want to redirect based on the hostname it will have to happen outside the switch statement as it only looks at the URI. Did you put the log statement into the iRule if so check the /var/log/ltm and make sure the iRule is see what you expect it to see.
Recent Discussions
Related Content
* 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