Forum Discussion
Joe_Pipitone
Nimbostratus
Feb 04, 2015Removing www and https redirect
I've applied the following iRule to a VIP on port 80. It successfully strips the www if there is one, and then redirects to the VIP on port 443.
I also want to apply this iRule to the VIP on port...
StephanManthey
Nacreous
Feb 04, 2015Hi, you can do the redirect conditionally via "elseif":
when HTTP_REQUEST {
if {([string tolower [HTTP::host]] starts_with "www.")} {
HTTP::redirect "https://[string range [HTTP::host] 4 end][HTTP::uri]"
return
} elseif { [TCP::local_port] == 80 } {
HTTP::redirect https://[HTTP::host][HTTP::uri]
return
}
}
Thanks, Stephan
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
