我想捕获在url中发送的所有参数并将其重定向传递给一个php文件。下面是我重写规则Apache重写规则url参数
RewriteCond %{REQUEST_METHOD} ^GET
RewriteRule ^/locations/(\w+\d*)+ /php/listone.php?name=$1 [L]
虽然时有没有空格在此URL中正常工作的情况下:
GET /locations/example HTTP/1.0
的$ _GET [“名”]在listone.php将包含例如,但当我送
GET /locations/ex1 ex2
GET /locations/ex%20ex2
GET /locations/ex1+ex2
在listone.php我给了以下内容:
$name = $_GET['name'];
echo $name;
$name = str_replace("+", " ", $name);
我会得到ex1。我如何捕获所有这些?