Forum Discussion
Ranvir_Floura_7
Nimbostratus
Mar 02, 2007iRule to redirect to a different url and change port from 80 to 443
Hello folks,
I am looking to combine to things with a iRule. Basically what i want is if a user comes to http://www.abc.com gets redirected to https://www.xyz.com. This is what i have so far:
when HTTP_REQUEST {
if { [HTTP::host] equals "www.abc.co" } {
HTTP::redirect "http://www.xyz.com[HTTP::uri]"
}
}
How do i do the http to https redirect within this same iRule?
Thanks!
- Wes_98712
Nimbostratus
Do the same thing, here is an example of how I do it:when HTTP_REQUEST { set my_uri [HTTP::uri] set my_host [HTTP::host] set my_query [HTTP::query] if { $my_host equals "www.abc.co" } { HTTP::redirect "https://www.xyz.com$my_uri" } else { pool somepool } }
- Marcus_Slawik_8Historic F5 Accountmaybe needless to say but after having the HTTP::redirect in place from http to https you obviously need a VS listing to 443 to take the redirected packages then.
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