简体   繁体   English

在CentOS7中无法访问Apache上的URL链接

[英]Can't access URL link on Apache in CentOS7

I have a system using PHP, httpd (Apache 2) and mod_security on CentOS 7.0. 我有一个在CentOS 7.0上使用PHP,httpd(Apache 2)和mod_security的系统。 This application is not programmed by me, I only operate and maintain. 此应用程序不是由我编写的,我只能操作和维护。

I have a problem that some PC in my office cannot access the web application URL. 我的办公室中的某些PC无法访问Web应用程序URL,这是一个问题。

Here is URL: 这是网址:

This is origin URL , it has two character "//" in this link: 这是原始网址 ,在此链接中有两个字符“ //”:

在此处输入图片说明

With two "//" character in url some PC can't access. 网址中有两个“ //”字符,某些PC无法访问。

If I change from "//" to "/", it accesses successfully. 如果我从“ //”更改为“ /”,则访问成功。

I want to change from "//" to "/" automatic. 我想从“ //”自动更改为“ /”。

I'm also Vietnamese. 我也是越南人

<?php

$uri = $_SERVER['REQUEST_URI'];

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

    header("Location: $uri");
}

This is the change: 这是更改:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM