如何修复“不可接受的 406”错误网址中的阿拉伯语错误?

发布于 2024-10-10 03:20:05 字数 520 浏览 0 评论 0原文

如何修复 url 中阿拉伯语的“不可接受的 406”错误?

不可接受

适当的表示 请求的资源/无法 在此服务器上找到。

此外,还有 404 Not Found 错误 尝试使用时遇到 ErrorDocument 来处理请求

当我在 url 中输入英文单词时,不会出现错误: http://www.faressoft.org/?anything=hello

但当我输入时它会出现网址中的阿拉伯语单词: http://www.faressoft.org/?anything= %E3%D1%CD%C8%C7%F0

我在所有页面都有这个问题。

How to fix the "Not Acceptable 406" error with arabic language in url ?

Not Acceptable

An appropriate representation of the
requested resource / could not be
found on this server.

Additionally, a 404 Not Found error
was encountered while trying to use an
ErrorDocument to handle the reque

The error doesn't appear when I put english words in the url :
http://www.faressoft.org/?anything=hello

but it appears when I put arabic words in the url :
http://www.faressoft.org/?anything=%E3%D1%CD%C8%C7%F0

I have this problem in all pages.

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

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

发布评论

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

评论(2

新人笑 2024-10-17 03:20:05

Apache 可能配置为字符集 UTF-8。但是 URL 的末尾解码为字节序列 E3D1CDC8C7F0,这不是有效的 UTF-8 字节序列。这可能就是 Apache 引发错误的原因。

E3D1CDC8C7F0 在什么字符集中是有效的字节序列? HTTP 标头包含哪些有关字符集的信息(您可以使用 Firefox 的 HTTP Live Header 插件来查找)?

更新:

显然,我的回答被否决了(没有任何评论)。然而,接受的答案和我的答案是相关的。我的答案给出了技术细节,接受的答案解释了哪个模块负责检查。

我仍然不明白你问题中的 URL 最初是如何创建的。我认为这不是一个有效的 URL。

我从您的网站复制了一些阿拉伯文本,对其进行 URL 编码并创建了以下 URL,该 URL 有效:

http://www.faressoft.org/?anything=%D9%87%D9%86%D8%A7%D9%83

当显示页面时,URL 在 Firefox 中甚至显示为阿拉伯字符。

您确定禁用 mod_security 可以解决您的问题吗?如果您的网址错误怎么办?

PS:由于我不懂阿拉伯语,我希望我没有复制任何在这个新上下文中侮辱性或令人困惑的文本。

Apache is probably configured to the character set UTF-8. But the end of your URL decodes to the byte sequence E3D1CDC8C7F0, which is not a valid UTF-8 byte sequence. That's probably why Apache raises an error.

In what character set is E3D1CDC8C7F0 a valid byte sequence? What information does the HTTP header contain about the character set (you can use the HTTP Live Header plug-in for Firefox to find out)?

Update:

Obviously, my answer got downvoted (without any comments). However, the accepted answer and my answer are related. My answer gives the technical details and the accepted answer explains which module is responsible for the check.

I still don't understand how the URL in your question was created in the first place. I don't think it's a valid URL.

I've copied some arabic text from your web site, URL encoded it and created the following URL, which works:

http://www.faressoft.org/?anything=%D9%87%D9%86%D8%A7%D9%83

When the page is displayed, the URL is even displayed with arabic characters in Firefox.

Are you sure, disabling mod_security will solve your problem? What if your URL is wrong?

P.S.: As I don't understand any Arabic I hope I didn't copy any text that is insulting or confusing in this new context.

有木有妳兜一样 2024-10-17 03:20:05

嗯,这可能有很多事情。首先,你有mod_security吗?这是一个 Apache 模块,据说可以使您的网站更加安全,但是如果没有真正深入了解它,只会破坏您的网站。只需将其关闭即可。

Hm, this can be a lot of things. First of all, do you have mod_security? That's an Apache module supposedly making your site more secure however without a real lot of understanding of it just breaks your site. Just switch it off.

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