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 23, 2015when HTTP_REQUEST {
switch -glob [HTTP::host][string tolower[HTTP::path]] {
"abc.com/product*" -
"abc.com/product2*" -
"abc.com/ers*" {
HTTP paths of abc.com as defined above are not redirected to HTTPS
return
}
"abc.com*" {
All other HTTP paths of abc.com are redirected to HTTPS
HTTP::respond 302 location "https://abc.com"
event disable
TCP::close
}
"osabc.com*" {
All HTTP paths of osabc.com are redirected to abc.com
HTTP::respond 302 location "http://abc.com"
event disable
TCP::close
}
}
}
Notes: you may remove the asterisks at the end of your exclusional HTTP paths (product, productX, ers) for an exact match.
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