Forum Discussion
HTTP 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.com/myuri
2 Replies
- Josiah_39459Historic F5 Account
when HTTP_REQUEST { HTTP::redirect https://www.mysite.com/myuri } - VernonWells
Employee
when 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
* 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