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
- hoolio
Cirrostratus
Hi Ijaz,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" } }
- 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? - 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_Walker_12Historic F5 AccountBeaten to it by hoolio. ;) I was thinking the same thing.
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