允许在 .htaccess mod_rewrite 中使用外来字符

发布于 2024-09-11 10:00:33 字数 90 浏览 1 评论 0原文

有没有办法允许 .htaccess mod_rewrite 字符集中出现外来字符?即,一种将 ç 等外来字符添加到 ([Az]+) 的方法?

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]+) ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

﹏半生如梦愿梦如真 2024-09-18 10:00:33

我不太确定 Apache 使用什么字符编码解释配置文件(如 .htaccess 文件)中的数据。但是您可以使用十六进制表示法 \xhh 来表达这些字符,例如:

# ç in ISO 8859-1
RewriteRule \xE7 …
# ç in UTF-8
RewriteRule \xC3\xA7 …

现在您需要知道的是这些字符在请求时如何编码(通常是 ISO 8859-1 或 UTF-8)。

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).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文