Forum Discussion
eirikn
Nimbostratus
Oct 15, 2015Redirection array iRule does not hit
Hi,
Our customer is moving four separate sites to the existing web environment and are in need of redirections of several URL's.
Let's call the sites:
www.alfasite.com
www.alfasite.se
www.betas...
Stanislas_Piro2
Cumulonimbus
Oct 15, 2015Hi,
your irule is so long...
it seems your have only a few redirect URLs, you can use a switch command instead of a array...
when HTTP_REQUEST {
Check the requested HTTP path
switch [string tolower [HTTP::host]] {
"www.alfasite.se" {
switch [string tolower [HTTP::path]] {
"/1011-inspiration-sign.aspx" -
"/11/10-spectacular-hair-show-at-selma-cityspa.aspx" -
"/11/12-dance,-dance,-dance!.aspx" {HTTP::respond 301 Location "https://www.existingsite.se/alfa/alfasite/featured-amenities/living-room/"; return}
"/105-girls-night-at-selma-cityspa.aspx" {HTTP::respond 301 Location "https://www.existingsite.se/alfa/alfasite/featured-amenities/living-room/"; return}
default {}
}
}
"www.alfasite.com" {
switch [string tolower [HTTP::path]] {
"/meeting.aspx" -
"/pictures-conference.aspx" {HTTP::respond 301 Location "https://www.existingsite.com/alfa/alfasite/conference-in-stockholm/"; return}
"/enlivingroom.aspx" -
"/livingroom_juli.aspx" -
"/13/11-living-room---traning.aspx" -
"/284-livingroom-by-juiceboy--swingkid.aspx" {HTTP::respond 301 Location "https://www.existingsite.com/alfa/alfasite/featured-amenities/living-room/"; return}
default {}
}
}
}
The minus character at the end of line is to do the same command for multiple statements.
the return command is to quit the irule
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