我想捕獲在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。我如何捕獲所有這些?