pbootcms 新版本中,加入了一个 url不允许带其他参数,这个也是为了安全,可以大大减少注入风险,
一但访客加入了其他?参数 ,就会出现404页面,
那我们怎么取消后缀参数过滤安全功能了,有写客户网站可能要推广什么的,推广公司可能需要带这些参数来统计报告,
下面我说下怎么解决。
打开:/apps/home/controller/IndexController.php
把 _404('您访问的内容不存在,请核对后重试!'); 都注销掉即可
if (P) { // 采用pathinfo模式及p参数伪静态模式
if ($url_rule_type == 2) { // 禁止伪静态时带index.php 和动态地址访问
if(stripos(URL, 'index.php') !== false){
// _404('您访问的内容不存在,请核对后重试!');
}
if(stripos(URL,'?') !== false && stripos(URL,'/?tag=') == false && stripos(URL,'/?page=') == false && stripos(URL,'/?ext_') == false){
// _404('您访问的内容不存在,请核对后重试!');
}
}
改完这个。内页所有页面都可以了。但是你会发现首页输入了?参数后。会进行301重定向,如果要解决这个看下面。
打开:/apps/home/controller/IndexController.php
if($matches1[0]){
if($_SERVER['REQUEST_URI'] == $matches1[0]){
$this->getIndexPage();
} elseif(strpos($matches1[0],'/?page=') !== false) {
$this->getIndexPage();
}else{
//读取后台首页404访问配置
if($this->config('url_index_404') == 1){
_404('您访问的页面不存在,请核对后重试!');
}
// header("Location: " . $http . $_SERVER['HTTP_HOST'] . $matches1[0], true, 301);
$this->getIndexPage();
}
} else {
_404('您访问的页面不存在,请核对后重试!');
}
}
注销
// header("Location: " . $http . $_SERVER['HTTP_HOST'] . $matches1[0], true, 301);
$this->getIndexPage();//加入这个