Forum Discussion
Sokol_69126
Nimbostratus
Apr 29, 2016Irule forwarding with various options
Hey Guys,
I've been asked to create a rule forwarding to various places depending on various requests. the options are as follows:
http://www.mysite.com https://www.be...
youssef1
Cumulonimbus
May 01, 2016Hello Sokol, Now I understand your need.
So to maitain the uri you have to use the follwing irule:
when HTTP_REQUEST {
if { ([HTTP::uri] eq "/") && (([HTTP::host] eq "mysite.com") || ([HTTP::host] eq "www.mysite.com")) } {
HTTP::redirect https://www.bettersite.com/mysite/
} else {
HTTP::redirect https://www.bettersite.com[HTTP::uri]
}
}
or to do more simple:
when HTTP_REQUEST {
if { [HTTP::uri] eq "/" } {
HTTP::redirect https://www.bettersite.com/mysite/
} else {
HTTP::redirect https://www.bettersite.com[HTTP::uri]
}
}
Regards
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