需要让EN codeD上的Apache斜杠 [英] Need to allow encoded slashes on Apache

查看:430
本文介绍了需要让EN codeD上的Apache斜杠的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在尝试将URL中的URL。例如:

I'm currently trying to place a URL within a URL. For example:

http://example.com/url/http%3A%2F%2Fwww.url2.com

我知道,我一定要带code中的URL,我都做了,但现在我从服务器,而得到一个 404 错误回比我的应用程序。我想我的问题在于Apache和可固定在 AllowEn codedSlashes在指令。

I'm aware that I have to encode the URL, which I have done, but now I am getting a 404 error back from the server rather than my app. I think my problem lies with apache and can be fixed with the AllowEncodedSlashes On directive.

我试过把指令在httpd.conf中没有效果的底部,我不能确定下一步该怎么做。难道我把它在正确的地方?如果是这样,没有任何人有任何其他的解决方案?

I've tried putting the directive at the bottom of the httpd.conf to no effect, and am unsure what to do next. Am I putting it in the right place? If so, does anyone have any other solutions?

推荐答案

编辑:见@ CaffeineComa的答案

See @CaffeineComa's answer.

这问题不涉及到Apache的Bug 35256.相反,它是关系到错误46830.的 AllowEn codedSlashes 设置不能通过虚拟主机继承的,虚拟主机在许多默认的Apache配置中使用,如一个在Ubuntu。解决方法是添加 AllowEn codedSlashes A &LT内部设置;虚拟主机> 容器(的/ etc / apache2的/网站的可用/默认在Ubuntu)。

This issue is not related to Apache Bug 35256. Rather, it is related to Bug 46830. The AllowEncodedSlashes setting is not inherited by virtual hosts, and virtual hosts are used in many default Apache configurations, such as the one in Ubuntu. The workaround is to add the AllowEncodedSlashes setting inside a <VirtualHost> container (/etc/apache2/sites-available/default in Ubuntu).

错误35256 %2F 将去codeD中PATH_INFO(文档,以 AllowEn codedSlashes 说,没有解码会做)

Bug 35256: %2F will be decoded in PATH_INFO (Documentation to AllowEncodedSlashes says no decoding will be done)

错误46830 :如果 AllowEn codedSlashes在在全局范围内设置,它不是由虚拟主机继承。你必须明确地设置 AllowEn codedSlashes在在每个&LT; VirtalHost方式&gt; 容器

Bug 46830: If AllowEncodedSlashes On is set in the global context, it is not inherited by virtual hosts. You must explicitly set AllowEncodedSlashes On in every <VirtalHost> container.

对于不同的配置部分如何合并文档说:

The documentation for how the different configuration sections are merged says:

&LT部分;虚拟主机&GT; 部分是虚拟主机的定义之外的相应部分后使用。这使得虚拟主机覆盖主服务器的配置。

Sections inside <VirtualHost> sections are applied after the corresponding sections outside the virtual host definition. This allows virtual hosts to override the main server configuration.

这篇关于需要让EN codeD上的Apache斜杠的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆