开发者

validating utf-8 in htaccess rewrite rule

开发者 https://www.devze.com 2022-12-26 00:44 出处:网络
i validate urls with utf-8 characters with a rewrite rule RewriteRule ^([a-z]{2})/([a-z0-9-]{1,256})/([[:print:]]{1,256})$ index.php?language=$1&categories=$2&get_query=$3 [L]

i validate urls with utf-8 characters with a rewrite rule

RewriteRule ^([a-z]{2})/([a-z0-9-]{1,256})/([[:print:]]{1,256})$ index.php?language=$1&categories=$2&get_query=$3 [L]

$get_query is the point, this accepts: test!?!'"<>*+ but fails for accented chars as àèéìòù, or other utf-8

for example in wiki开发者_StackOverflow中文版pedia this works great: http://en.wikipedia.org/wiki/%E6%B1%89%E8%AF%AD_%E6%BC%A2%E8%AA%9E

any help? :-)


:print: is [\x20-\x7E] so doesn't include non-ASCII characters. If you want to allow anything, why not just .*, or maybe [^/]*?

0

精彩评论

暂无评论...
验证码 换一张
取 消