Forum Discussion
Ijaz_37879
Nimbostratus
Jun 29, 2009URI redirection
Hello:
Can somebody validate the following iRule?
when HTTP_REQUEST {
if {[HTTP::uri] equals {http://www.abc.com/123}} {HTTP::uri {https://www.123.com/xyz}
}
}
I need to redirect a HTTP request to HTTPS.
Thanks,
Ijaz
6 Replies
- hoolio
Cirrostratus
Hi Ijaz,
If you want to redirect a client from http to https by sending them a 30x redirect, you can use an iRule like this:when HTTP_REQUEST { Check if host header and URI match if {[string tolower [HTTP::host]] eq "www.abc.com" && [HTTP::path] starts_with "/123"}{ Redirect client to new host and URI HTTP::redirect "https://www.123.com/xyz" } }
If you want to send some requests to one pool via SSL and other requests to another pool without SSL, let me know and I can provide another example.
Aaron - Ijaz_37879
Nimbostratus
Thanks Aaron. - Jessica_42876
Nimbostratus
Thanks for everything - hoolio
Cirrostratus
Do you have a space in the name you're trying to use for the iRule? You can't use spaces in most LTM object names. Can you try redirect_alumno or something like that?
Aaron - Colin_Walker_12Historic F5 AccountThe iRule looks correct to me, could you paste the entire log entry to show the source of the error?
Colin - Colin_Walker_12Historic F5 AccountBeaten to it by hoolio. ;) I was thinking the same thing.
Colin
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