Forum Discussion
Michael_-_Harr1
Nimbostratus
May 29, 2014REDIRECT IRULE need some help
I need help configuring a IRULE to redirect .com traffic to .org wether it is http or https
http:\mobilebank.com https:\www.mobilebank.org
https:\mobilebank.com https:\www.mobilebank.org
nitass
Employee
May 29, 2014this is an example for http. for https, just change HTTP::redirect command from http to https.
e.g.
config
[root@ve11a:Active:In Sync] config tmsh list ltm rule qux
ltm rule qux {
when HTTP_REQUEST {
if { [HTTP::host] ends_with ".com" } {
HTTP::redirect "http://[string map {.com .org} [HTTP::host]][HTTP::uri]"
}
}
}
test
[root@ve11a:Active:In Sync] config curl -I http://172.28.24.10/something -H "Host: mobilebank.com"
HTTP/1.0 302 Found
Location: http://mobilebank.org/something
Server: BigIP
Connection: Keep-Alive
Content-Length: 0
[root@ve11a:Active:In Sync] config curl -I http://172.28.24.10/something -H "Host: www.mobilebank.com"
HTTP/1.0 302 Found
Location: http://www.mobilebank.org/something
Server: BigIP
Connection: Keep-Alive
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