某页URL有两个:
http://domain/Home/column/abount-us.html [希望返回404]
http://domain/column/about-us.html [正确URL]
解决办法:
1、开启404,即不存在的页面手动返回404,EmptyController.class.php
<?php
//EmptyController.class.php
namespace Home\Controller;
use Think\Controller;
class EmptyController extends Controller{
function _empty(){
header("HTTP/1.0 404 Not Found");//使HTTP返回404状态码
$this->display("Public:404");
}
}
?>2、配置文件'MODULE_ALLOW_LIST' => array('Admin','Wechat','3g'), //没有Home
'MULTI_MODULE' => true,
'DEFAULT_MODULE' => 'Home',//有Home 最佳答案