Forum Discussion
Joseph_Johnson_
Nimbostratus
Jul 14, 2014HTTP Redirect to Different Domain
Hi,
I am fairly new to F5 irules and i have been tasked with setting up a redirect from a marketing url to the login of an already established site within our company. I am using a simple url r...
JRahm
Admin
Jul 14, 2014What URLs on those hosts do you want to send to a login page? Do you want to tie that to the presence of a session of a cookie? Might end up with some redirect loops otherwise. The basic structure you are looking for:
when HTTP_REQUEST {
switch [HTTP::host] {
"www.sub.com" {
if { [string tolower [HTTP::uri]] eq "" } {
HTTP::respond 301 Location "http://sub.domain.com/OLA/faces/login.jspx?"
}
}
"sub.domain.com" -
"domain2.com" {
if { [string tolower [HTTP::uri]] eq "" } {
HTTP::respond 301 Location "http://[HTTP::host]/OLA/faces/login.jspx?"
}
}
default { reject }
}
}
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
