如何编写 htaccess - mod_rewrite 多语言检索查询字符串值的规则?
How to write htaccess - mod_rewrite rules for retrieving querystring values in multiple languages?
重写规则
^([a-zA-Z0-9%_-]+)([\.|\/|@|%])([a-zA-Z0-9%_-]+)/$ index.php?t=&v=&q= [QSA]
这是尝试捕获查询字符串值。我应该如何替换
[a-zA-Z0-9%_-]
这样所有 UTF-8
或就此而言 UTF-16
值都被视为有效输入?
环境是Apache2 - PHP 5.6+
传入查询:
example.com/query/información@importante
example.com/query/महत्वपूर्ण@जानकारी
example.com/query/முக்கியமான@தகவல்
example.com/query/důležitá@informace
预期变量:
t=información
v=@
q=importante
在 query/.htaccess
中尝试此规则:
RewriteRule ^([^/@]+)(@)([^/]+)/?$ index.php?t=&v=&q= [QSA,L]
重写规则
^([a-zA-Z0-9%_-]+)([\.|\/|@|%])([a-zA-Z0-9%_-]+)/$ index.php?t=&v=&q= [QSA]
这是尝试捕获查询字符串值。我应该如何替换
[a-zA-Z0-9%_-]
这样所有 UTF-8
或就此而言 UTF-16
值都被视为有效输入?
环境是Apache2 - PHP 5.6+
传入查询:
example.com/query/información@importante
example.com/query/महत्वपूर्ण@जानकारी
example.com/query/முக்கியமான@தகவல்
example.com/query/důležitá@informace
预期变量:
t=información
v=@
q=importante
在 query/.htaccess
中尝试此规则:
RewriteRule ^([^/@]+)(@)([^/]+)/?$ index.php?t=&v=&q= [QSA,L]