Is there a way to allow foreign characters in .htaccess mod_rewrite character sets? i.e., a way to add foreign characters like ç and others to ([A-z]+)
?
views:
10answers:
2
A:
you're using regular expressions, right? Take a look at this link: http://www.regular-expressions.info/unicode.html
Vidar Nordnes
2010-07-26 14:03:30
+1
A:
I’m not quite sure with what character encoding Apache interprets the data in configuration files like the .htaccess file. But you can express these characters with the hexadecimal notation \xhh
like:
# ç in ISO 8859-1
RewriteRule \xE7 …
# ç in UTF-8
RewriteRule \xC3\xA7 …
Now all you need to know is how these characters are encoded when requested (in general either ISO 8859-1 or UTF-8).
Gumbo
2010-07-26 14:03:35
so something like `RewriteRule /name/([A-z\xE7\xC3\xA7(and all other foreign characters allowed)]+) index.php?user=$1` ?
ina
2010-07-26 15:09:16
@ina: No, when using multi-byte characters you need to use an alternation like `([A-z\xE7]|\xC3\xA7)+)`.
Gumbo
2010-07-26 15:38:15