Forum Discussion
kraigk_52257
Nimbostratus
Jul 01, 2015Inefficient iRule, works but not perfect
We have a working iRule that I'm sure can be improved/. The first section is simple redirects from domain.org URL to equivalent https domain.com URL. We discovered that if users browsed directly to...
kraigk_52257
Nimbostratus
Jul 03, 2015Nathan, I did finally get to test and it works well. We added short names as well as they were hitting the vs and failing. Not sure if there is a better way to incorporate them into this. Thanks for your suggestions.
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::host]] {
"team" { HTTP::respond 301 Location "https://team.domain.com[HTTP::uri]" }
"site1" { HTTP::respond 301 Location "https://site1.domain.com[HTTP::uri]" }
"site2" { HTTP::respond 301 Location "https://site2.domain.com[HTTP::uri]" }
"myteam" { HTTP::respond 301 Location "https://myteam.domain.com[HTTP::uri]" }
"team.domain.org" { HTTP::respond 301 Location "https://team.domain.com[HTTP::uri]" }
"site1.domain.org" { HTTP::respond 301 Location "https://site1.domain.com[HTTP::uri]" }
"site2.domain.org" { HTTP::respond 301 Location "https://site2.domain.com[HTTP::uri]" }
"myteam.domain.org" { HTTP::respond 301 Location "https://myteam.domain.com[HTTP::uri]" }
"*.domain.com" { HTTP::respond 301 Location "https://[HTTP::host]/default.aspx" }
}
}
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