我在 php 中实现了路由,一切正常,除非我尝试像这样在 url 上发送数据:
http://localhost/search/?sprefix=all
有时它看起来像这样:
http://localhost/search/?sprefix=Sippers%20&%20Mugs+sprefix_sub=children%20mugs
这是我的路线
<?php
$request = $_SERVER['REQUEST_URI'];
switch ($request) {
case '/search/':
require __DIR__ . '/views/Product/Search/Search.php';
break;
}
?>
和.htaccess文件
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.+)$ index.php [QSA,L]
有人可以帮我做到这一点吗?
qq_遁去的一_1