Forum Discussion
Yolanda_Almonte
Nimbostratus
Oct 09, 2013Need iRule for 301 redirection
I would like to ask expert assistance creating an iRule on the LTM to perform a 301 redirection. The following is required:
If requested URL contains hostname example.edu (not case sensitive)...
Kevin_Stewart
Employee
Oct 09, 2013Combined iRule:
when HTTP_REQUEST {
switch [string tolower [HTTP::host]] {
"example.edu" {
HTTP::respond 301 Location "http://www.example.edu[HTTP::uri]"
}
"new.example.edu" {
HTTP::respond 301 Location "http://www.example.edu[HTTP::uri]"
}
}
}
You wouldn't want to use a "contains" (or glob) operator here because the redirect URL contains the same host name - a potential loop.
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