我在 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 OnRewriteBase /RewriteCond %{REQUEST_FILENAME} !-dRewriteCond %{REQUEST_FILENAME} !-fRewriteRule ^(.+)$ index.php [QSA,L]有人可以帮我做到这一点吗?
添加回答
举报
0/150
提交
取消