为什么阿帕奇删除多个斜线? [英] Why is Apache removing multiple slashes?

查看:182
本文介绍了为什么阿帕奇删除多个斜线?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

该重写规则

重写规则^测试/(.*)$ test.php的?URL = $ 1

在这个网址

mysite.com/test//one /// 2 //// /// 3

是给我这样的结果

$ 1 = URL ='一/两/三/

我使用的EasyPHP如果它很重要,我想知道的为什么阿帕奇去除内部多个斜线不重定向到correcred网址是什么?我怎么可以禁用或添加重定向​​到这种行为?

I'm using easyphp if it matters and I like to know why is Apache removing multiple slashes internally without redirecting to correcred URL? and how can I disable or add a redirect to this behaviour?

感谢提前

推荐答案

似乎多斜线反对的标准。正如在这个职位 RFC 1630 说:

It seems multiple slashes are against the standard. As pointed out in this post, RFC 1630 says:

PATH

URI的其余遵循的格式结肠取决于        方案。该路径是跨preTED的方式依赖于         正在使用的协议。然而,当它含有斜线,这些         乌斯意味着分层结构

The rest of the URI follows the colon in a format depending on the scheme. The path is interpreted in a manner dependent on the protocol being used. However, when it contains slashes, these ust imply a hierarchical structure.

/// 并不意味着层次结构 - 你必须为空文件夹名称。从我猜想,Apache的行为是设计使然。 (也不会是一个好主意,用多个斜线,因为其结果将是无效的URL)。

/// does not imply a hierarchical structure - you'd have empty folder names. From that I would guess that Apache's behaviour is by design. (Nor would it be a good idea to use multiple slashes, as the result would be an invalid URL).

我会用不同的字符来代替。

I would use a different character instead.

这篇关于为什么阿帕奇删除多个斜线?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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