Tomcat:solaris 目录中的法语口音

发布于 2024-07-29 18:44:51 字数 428 浏览 8 评论 0原文

我们的一位客户在报纸上购买了一份宣传并添加到他的 URL 中: http://www.website.com/publicité 而不是“ publicite”(不带重音)...

我试图在 Solaris 下创建相应的目录,但它似乎不起作用。 我抓住了“get”请求,看起来“真正的”请求是 /publicit%C3%A9 我们尝试添加一个具有该名称的目录,但它也不起作用。

知道网络如何解决这个问题吗?

我们使用 Apache 和 Tomcat 作为带有 JAVA(和 jsp)的 Web 容器

看起来它是一个 Solaris 服务器而不是 Linux。

One of our client bought a publicity in a newspaper and added to his URL :
http://www.website.com/publicité instead of "publicite" (without the accent)...

I'm trying to make the corresponding directory under Solaris and it doesn't seems to work.
I grabbed the "get" request and it looks like the "real" request is /publicit%C3%A9
We tried to add a directory with that name but it doesn't work either.

Any idea of how web could fix this problem?

We use Apache and Tomcat as our web container with JAVA (and jsp)

Looks like it's a Solaris server and not a linux..

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

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

发布评论

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

评论(3

一影成城 2024-08-05 18:44:51

也许您可以使用 Apache 的 mod_rewrite 将其更改为 publicite (无重音)?

Perhaps you could use Apache's mod_rewrite to change it to publicite (no accent)?

故人如初 2024-08-05 18:44:51

看起来该请求已经过 URL 编码。 棘手的是,它不是标准 ASCII 格式,所以我认为它不能可靠地解码为正确的“é”(因为你无法仅从 URL 知道它最初是 Unicode 而不是 ASCII 格式)。

显然,也没有编码“é”的标准,因此对于来自两个不同客户端的相同请求,您收到的 URL 可能会有所不同。

祝你好运。

Looks like the request has been URL-encoded. The tricky thing is, it's not in standard ASCII, so I don't think it can be reliably decoded to the correct "é" (because you don't know just from the URL that it was originally in Unicode and not ASCII).

Apparently, there is also no standard for encoding "é" either, so the URL you receive might be different for the same request from two different clients.

Good luck.

っ〆星空下的拥抱 2024-08-05 18:44:51

我试图在linux下制作相应的目录,但似乎不起作用。

您到底尝试了什么,怎么失败的?

你可以尝试这个(在 bash 中):

cd /var/www/html   ## -- Change as needed.
dname=$(echo -en "publicit\0303\0251")
mkdir publicite
ln -s publicite "$dname"

这是 Paul 使用重写的想法的简单版本。

顺便说一句,我刚刚通过粘贴此页面和上面的命令中的文本,毫无问题地创建了一个目录“publicité”。 Apache 在浏览器中很好地列出了空目录(Linux 和 WXP 上的 Firefox),尽管我的英语配置的 Apache 弄乱了列表中的名称:

Index of /xtra/publicité
[ICO]   Name    Last modified   Size    Description
[DIR]   Parent Directory        -
Apache/2.2.3 (CentOS) Server at localhost Port 80

而且我从 Apache 访问日志中看到的内容与您相同:”获取 /xtra/publicit%c3%a9/ HTTP/1.1"

I'm trying to make the corresponding directory under linux and it doesn't seems to work.

What exactly did you try, and how did it fail?

You could try this (in bash):

cd /var/www/html   ## -- Change as needed.
dname=$(echo -en "publicit\0303\0251")
mkdir publicite
ln -s publicite "$dname"

This is a simple version of Paul's idea to use rewrite.

BTW, I just created a directory "publicité" with no problem by pasting text from this page, and from the commands above. Apache lists the empty directory fine in the browser (Firefox on Linux and WXP), albeit my English-configured Apache messed up the name in the listing:

Index of /xtra/publicité
[ICO]   Name    Last modified   Size    Description
[DIR]   Parent Directory        -
Apache/2.2.3 (CentOS) Server at localhost Port 80

And I'm seeing the same as you from the Apache access log: "GET /xtra/publicit%c3%a9/ HTTP/1.1"

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