Forum Discussion
Joe_Pipitone
Nimbostratus
Jul 20, 2009Simple HTTP Redirection - case sensitive?
Hello all,
I am running Big-IP 9.4.7.
I currently have a variety of redirects in place using string match, however if a user types a URI in upper case, the iRule doesn't work. Can anyone tell me what the easiest method of string matching would be? Here's an example of what I have now - as you can see, I had to create 2 separate if statements to catch both instances, but there could also be times when Membership was capitalized, when renew was not:
when HTTP_REQUEST {
if { [string match "*website.org/Membership/Renew" "[HTTP::host][HTTP::uri]"] } {
HTTP::redirect "https://www.website.org/Membership/Renewform.aspx"
}
if { [string match "*website.org/membership/renew" "[HTTP::host][HTTP::uri]"] } {
HTTP::redirect "https://www.website.org/Membership/Renewform.aspx"
}
}
I've read an article about using a string related iRule? Can I use something like that for this example? I'd have to match the host name as well (website.org)
Thank you for any help!
- dennypayne
Employee
Hi,when HTTP_REQUEST { if { [string tolower [HTTP::uri]] eq "/membership/renew" } { HTTP::redirect "https://www.website.org/Membership/Renewform.aspx" }
- Joe_Pipitone
Nimbostratus
Thanks - with some modification I was able to get your rule working - I appreciate your help!if { [string tolower [HTTP::uri]] equals "/marketing/hello" } { HTTP::redirect "http://www.website.org/Redirects/Marketing/CampaignStart.ASPX?CampaignId=2466" }
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