Forum Discussion
DM_5174
Nov 07, 2007Nimbostratus
Case-sensitive URL Redirection
Hello all,
I have created a 4x iRule that will redirect based on specific
words after the FQDN "http://%h/". So if i put "http://www.primarysite.com",
i get redirected to the main ...
hooleylist
Nov 07, 2007Cirrostratus
Hello,
If you're running 4.6.x, you can use the tolower function to set the URI to lowercase before doing the string comparison. Else, in previous versions, you can use matches_regex.
tolower:
if ((tolower(http_host)) == "www.primarysite.com" and (tolower(http_uri) == "/home")){
matches_regex:
if (http_host matches_regex "(?i:www.primarysite.com)" and http_uri matches_regex "(?i:/home)"){
The ?i: portion of the regex enables a case-insensitive comparison and doesn't capture the matching string into a backreference.
I haven't tested the i flag, but it's a standard regex option so I expect it would work. If not, you could use the [hH][oO][mM][eE] approach.
Aaron
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