Forum Discussion
kaviraj_Daboo_1
Nimbostratus
Jul 04, 2013HTTP-HTTPS redirection
Hello,
Kevin_Stewart
Employee
Jul 10, 2013Can you add some log statements back to the iRule and test again:
when HTTP_REQUEST {
log local0. "uri = [HTTP::uri]:[TCP::local_port]"
if { [string tolower [HTTP::host]] equals "test.domain.com" } {
switch -glob [string tolower [HTTP::uri]] {
"/y/z/*" {
log local0. "y/z/*"
return
}
"/y/z" {
log local0. "y/z"
HTTP::uri "[HTTP::uri]/"
return
}
"/y/*" {
log local0. "/y/*"
if { [TCP::local_port] ne "443" } {HTTP::redirect "https://[HTTP::host][HTTP::uri]" }
}
"/y*" {
log local0. "/y*"
if { [TCP::local_port] ne "443" } {HTTP::redirect "https://[HTTP::host][HTTP::uri]" }
}
"/*" {
log local0. "/*"
if { [TCP::local_port] ne "80" } { HTTP::redirect "http://[HTTP::host][HTTP::uri]" }
}
default {
log local0. "drop"
drop
}
}
}
}
Please also use "-Xs0" in your TCPDUMP parameters.
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