Forum Discussion
Pramod_Gopala_1
Nimbostratus
Mar 17, 2016HTTP all context to single HTTPS redirection
Hi All,
Can you help me out writing an irule to redirect all the HTTP traffic to single HTTPS URI. example: www.mysite.com and www,mysite.com/myuri has to be redirected to to https://www.mysite....
VernonWells
Employee
Mar 18, 2016when HTTP_REQUEST {
if { [string tolower [HTTP::host]] ne "www.mysite.com" && [HTTP::path] ne "/myuri" } {
HTTP::redirect "https://www.mysite.com/myuri"
}
}
If you have two Virtual Servers -- one for HTTP traffic and one for HTTPS traffic (with TLS offloading) -- and you only want to redirect things going to the first Virtual Server (and thus, only traffic going to http:// and specifically, not traffic going to then you could simply do this on the HTTP Virtual Server:
when HTTP_REQUEST {
HTTP::redirect "https://www.mysite.com/myuri"
}
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