Forum Discussion
Abhash_way_1901
Nimbostratus
Aug 01, 2017.com. doesn't redirect but .com does
Hello Everyone,
Quick question regarding a re-direct irule. so we have a requirement to redirect example.com and exampleabc.com to examplexyz.com and this works via the following irule but if appe...
Stanislas_Piro2
Cumulonimbus
Aug 01, 2017Hi,
switch command evaluate exact value.
example.com us not the same string than example.com.
when HTTP_REQUEST {
switch -- [HTTP::host] {
"www.example.com" -
"www.example.com." -
"www.exampleabc.com" -
"www.exampleabc.com." {
HTTP::respond 301 "Location" "https://www.examplexyz.com"
}
}
}
you can also use glob option to use wildcard
when HTTP_REQUEST {
switch -glob -- [HTTP::host] {
"www.example.com?" -
"www.exampleabc.com?" {
HTTP::respond 301 "Location" "https://www.examplexyz.com"
}
}
}
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
