Forum Discussion
Karlsen_58024
Nimbostratus
Nov 28, 2012HTTP Redirection iRules
Hi,
A customer wanted a new web solution and chose Big-IP 3900 to use as a load balancer. They want to migrate from the existing environment to the new one with as little downtime / 404 errors a...
nitass
Employee
Nov 28, 2012what about this one?
[root@ve11a:Active:Changes Pending] config tmsh list ltm virtual bar
ltm virtual bar {
destination 172.28.19.252:443
ip-protocol tcp
mask 255.255.255.255
profiles {
clientssl {
context clientside
}
http { }
tcp { }
}
rules {
myrule
}
snat automap
vlans-disabled
}
[root@ve11a:Active:Changes Pending] config tmsh list ltm data-group internal redirection_class
ltm data-group internal redirection_class {
records {
/AboutThisPage {
data /About/Page.aspx
}
/hey/whatsup.aspx {
data /abc/def/example.aspx
}
/page206.aspx {
data /subsite/URI/page.aspx
}
/thisisanoldsite {
data /this/is/the/equivilant/site
}
}
type string
}
[root@ve11a:Active:Changes Pending] config tmsh list ltm rule myrule
ltm rule myrule {
when HTTP_REQUEST {
if { [string tolower [HTTP::host]] equals "example.com" } {
if { [class match -- [HTTP::uri] equals redirection_class] } {
HTTP::respond 301 noserver Location "https://www.example.com[class match -value [HTTP::uri] equals redirection_class]" Connection Close
}
}
}
}
[root@ve11a:Active:Changes Pending] config curl -Ik https://example.com/AboutThisPage
HTTP/1.0 301 Moved Permanently
Location: https://www.example.com/About/Page.aspx
Connection: close
Content-Length: 0
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