验证UTF-8 htaccess的重写规则 [英] validating utf-8 in htaccess rewrite rule
问题描述
我的网址进行验证使用UTF-8字符重写规则
i validate urls with utf-8 characters with a rewrite rule
重写规则^([AZ] {2})/([A-Z0-9 - ] {1256})/([[:打印:]] {1256})?$的index.php语言= $ 1安培;类别= $ 2及get_query = $ 3 [L]
RewriteRule ^([a-z]{2})/([a-z0-9-]{1,256})/([[:print:]]{1,256})$ index.php?language=$1&categories=$2&get_query=$3 [L]
$ get_query是点,这个接受:测试'<> * +!?! 但失败重音字符作为àèéìòù,或其他UTF-8
$get_query is the point, this accepts: test!?!'"<>*+ but fails for accented chars as àèéìòù, or other utf-8
例如,在维基百科这样的伟大工程:的 http://en.wikipedia.org/wiki/%E6%B1%89%E8%AF%AD_%E6%BC%A2%E8%AA%9E
for example in wikipedia this works great: http://en.wikipedia.org/wiki/%E6%B1%89%E8%AF%AD_%E6%BC%A2%E8%AA%9E
任何帮助吗? : - )
any help? :-)
推荐答案
:打印:
是 [\ x20- \ x7E]
因此不包括非ASCII字符。如果你想允许什么,为什么不直接。*
,或者 [^ /] *
?
:print:
is [\x20-\x7E]
so doesn't include non-ASCII characters. If you want to allow anything, why not just .*
, or maybe [^/]*
?
这篇关于验证UTF-8 htaccess的重写规则的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!