Forum Discussion
heskez_36146
Nov 13, 2013Nimbostratus
Redirection multiple URLS
Hi,
We've two websites www.x.com/GoWest and www.x.com/GoSouth
We'd like an Irule which redirects to:
GoWest -> www.y.com/Gowest and GoSouth -> www.y.com/GoSouth
Therefore We've build an iru...
- 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" } } }
heskez_36146
Nov 13, 2013Nimbostratus
I see thanks :) I'm not redirected to the correct site I'm getting the famous: "Internet explorer cannot display the webpage" Over and over..
- Richard__HarlanNov 13, 2013Historic F5 AccountMost likely you are getting a 404/500, IE turns small error pages into the page you are seeing. The ltm logs will show what the BigIP is seeing and what it should pick in the switch statement. If you take a HTTPwatch or fiddler you will see the error statement from the server, or you can try the same site with firefox and it will show the real error.
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