Forum Discussion
dkinsler_23191
Nimbostratus
Jan 26, 2010Most efficient way to write this
My devs are asking me to Do many many redirects based on various mispellings our our URL's. I am worried about the extra processing of every request going through these lists of if/then statements. ...
The_Bhattman
Nimbostratus
Jan 26, 2010Hi dkinslerUser,
I suppose you could use the switch command with IF statements
Here is untested example
when HTTP_REQUEST {
switch -glob [string tolower[HTTP::host]] {
"connection1.net" -
"connecton1.org" -
"connection1.biz" -
"connection2.com" - { HTTP::redirect "http://www.connection1.com[HTTP::uri] }
default {
if [HTTP::uri] eq "/" } {
switch -glob [string tolower[HTTP::host]] {
"www.connection1.org" -
"www.connection1.net" -
"www.connection1.biz" -
"www.connection1.com" { HTTP::redirect "http://www.connection1.com/folder1/home.aspx" }
}
}
}
}
}
Bhattman
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
