Forum Discussion
Swedish characters in a irule
Hi i need a redirect rule for a swedish url containing the swedish character ä
when HTTP_REQUEST { if { [string tolower [HTTP::uri]] equals "www.xxx.se/berätta" } { HTTP::respond 301 Location "http://192.168.14.11" } }
Is this possible ? As is the the irule editor will not let me save it.
/Craig
3 Replies
- hoolio
Cirrostratus
The client should URL encode non-ascii characters. Can you try logging the [HTTP::uri] value to confirm this?
Also, the [HTTP::uri] value will not typically include the host name.
https://devcentral.f5.com/wiki/iRules.http__uri.ashx For the following URL:
http://www.example.com:8080/main/index.jsp?user=test&login=check
The URI is:
/main/index.jsp?user=test&login=check
Aaron
- CGI
Altostratus
Hi i used the following in the end but it seems to be different depending on what browser you use, IE and firefox work but chrome does not.
when HTTP_REQUEST { log local0. "Path = [HTTP::path]" if { [string compare "ber%C3%A4tta" [HTTP::path]] } { log local0. "Redirect to Satchi site" }
HTTP::respond 301 Location "http://91.196.242.118" }/Craig
- Don_Flinspach_1Historic F5 Account
Any time I have to do anything with non-ASCII characters, I will also create a variable that’s a b64decode of a base64-encoded string and perform comparisons against that. Given the prevalence of UTF-8–capable browsers, it’s not unreasonable to expect them to send words in other languages’ character sets anymore.
For example, set test_uri_1 [b64decode "YmVyw6R0dGE="]
There’s a little front-end work done here, but I’ve had this work regularly.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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