Forum Discussion
kaviraj_Daboo_1
Nimbostratus
Jul 04, 2013HTTP-HTTPS redirection
Hello,
Kevin_Stewart
Employee
Jul 05, 2013Try this:
when HTTP_REQUEST {
if { [string tolower [HTTP::host]] equals "test.domain.com" } {
switch -glob [string tolower [HTTP::uri]] {
"/y/z*" {
return
}
"/y/*" {
if { [TCP::local_port] ne "443" } { HTTP::redirect "https://[HTTP::host][HTTP::uri]" }
}
"/y*" {
if { [TCP::local_port] ne "443" } { HTTP::redirect "https://[HTTP::host][HTTP::uri]" }
}
"/*" {
if { [TCP::local_port] ne "80" } { HTTP::redirect "http://[HTTP::host][HTTP::uri]" }
}
default { drop }
}
}
}
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