爲什麼要識別“?” 以爲改版之前客戶網站的url已被百度大量收錄。
有更好解決方案的朋友留言指教
//預處理路由
$path=$_SERVER[REQUEST_URI];
preg_match('/(list\/\?(\d+)_(\d+)\.html)|(about\/\?(\d+)\.html)|(content\/\?(\d+)\.html)/',$path,$matches);
if($matches[0]){
$router=$matches[0];
$router=str_replace('?','',$router);
$router=str_replace('.html','',$router);
$router=str_replace('_','/',$router);
$_SERVER[PATH_INFO]=$router;
var_dump($router);
}