.htaccess的重写规则,接受特殊字符 [英] Htaccess RewriteRule to accept special characters
本文介绍了.htaccess的重写规则,接受特殊字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的htaccess重写必须处理这些情况:
My htaccess rewrite must handle these scenarios:
- http://example.com/words /潘塔隆
- http://example.com/words/pantal%C3%B3n
- http://example.com/words /阅兵式+塞诺拉
- http://example.com/words/pantalón
- http://example.com/words/pantal%C3%B3n
- http://example.com/words/señor+señora
我目前的.htaccess配置为:
My current .htaccess configuration is:
RewriteRule ^dictionary/([\w\+]{2,50})$ /words.php?q=$1 [QSA,L]
这是不承认的特殊字符,如:N,O
It is not recognizing the special chars, e.g.: ñ, ó.
任何想法?谢谢!
推荐答案
最终的解决方案
RewriteRule ^dictionary/([^/.]+)$ /words.php?q=$1 [QSA,L]
这篇关于.htaccess的重写规则,接受特殊字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文