Forum Discussion
together_183451
Nimbostratus
Apr 21, 2015URL Redirection from Https to Http
I have to Two applications in One server, named as osabc.com and abc.com.
What redirection I need is:
1) If request comes from http://abc.com then it should redirect to https://abc.com
2) If request...
Hannes_Rapp
Nimbostratus
Apr 21, 2015I'm assuming the "if request comes from" actually means the client is requesting the Host specified? Depending on how your DNS resolves and how you've configured your Virtual Server TCP listeners, the iRule below should do the job.
when HTTP_REQUEST {
if { [HTTP::host] == "abc.com" }{
HTTP::respond 302 location "https://abc.com"
event disable
TCP::close
} elseif { [HTTP::host] == "osabc.com" }{
HTTP::respond 302 location "http://abc.com"
event disable
TCP::close
} else {
Do nothing; the request will be routed to a back-end server as defined in default pool applied to a VS.
}
}
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