Forum Discussion
Heidi_35827
Nimbostratus
Nov 08, 2011iRule for HTTP redirect from retired URL to new URL
I'm new to iRules and could use some help. I think I have a pretty basic question but I'm not finding the answer after a few searches in DevCentral.
Here is what I'm trying to do....we ha...
nitass
Employee
Jun 19, 2013will it work, or do have to made any changes in it.yes, it could work. if you want more specific, switch case can also be used.
e.g.
[root@ve10:Active] config b rule myrule list
rule myrule {
when HTTP_REQUEST {
switch [HTTP::host] {
"example.in" -
"www.example.in" {
HTTP::redirect "http://home.example.co.in[HTTP::uri]"
}
}
}
}
[root@ve10:Active] config curl -IL http://example.in/something
HTTP/1.0 302 Found
Location: http://home.example.co.in/something
Server: BigIP
Connection: Keep-Alive
Content-Length: 0
HTTP/1.1 404 Not Found
Date: Wed, 19 Jun 2013 14:14:19 GMT
Server: Apache/2.2.3 (CentOS)
Connection: close
Content-Type: text/html; charset=iso-8859-1
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