Forum Discussion
chungyu_16122
Mar 28, 2012Altostratus
iRule redirects for HTTP::uri
Hi all
I wrote a irule for some simple HTTP redirect but found that a single / inserted by the user was casue the rule to break.
For example user tries to reach french.school.ca/students and I redirect to http:://www.school.ca/fr/student.
But if the user tries french.school.ca/students/ then the irule would not work.
when HTTP_REQUEST {
if { [HTTP::host] equals "francais.mcgill.ca" and [HTTP::uri] equals "/students" } {
HTTP::redirect "http://www.mcgill.ca/fr/students"
}
}
I tried the equals "/students/ as well, but that did not work.
Can anyone shed some light on the syntax I could use.
thanks
Chung
1 Reply
Sort By
- Have you tried replacing the "equals" operator with "starts_with"?
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