简体   繁体   中英

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. 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.

Here is URL:

This is origin URL , it has two character "//" in this link:

在此处输入图片说明

With two "//" character in url some PC can't access.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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