在 CentOS7 的 Apache 上无法访问 URL link

Can't access URL link on Apache in CentOS7

我有一个在 CentOS 7.0 上使用 PHP、httpd (Apache 2) 和 mod_security 的系统。这个应用不是我写的,我只是运维。

我有一个问题,我办公室的一些 PC 无法访问 Web 应用程序 URL。

这里是URL:

This is origin URL,在这个link:

中有两个字符"//"

有两个“//”字符 url 部分电脑无法访问

如果我把“//”改成“/”,就访问成功了。

我想将“//”自动更改为“/”。

我也是越南人

<?php

$uri = $_SERVER['REQUEST_URI'];

if (strpos($uri, '//') !== false) {
    $uri = str_replace('//', '/', $uri);

    header("Location: $uri");
}

这是变化:

BEFORE: http://127.0.0.1/test.php//?&mod=server
AFTER: http://127.0.0.1/test.php/?&mod=server