1

我最近遇到了wordpress的Redirection plugin,这使得它很容易捕获正在创建404错误的链接,然后设置相同的301重定向。我正在为我的prestashop网站寻找类似的东西。有没有prestashop模块?如果没有,有没有其他方法可以修改代码以跟踪404页面或通过apache访问/错误日志。任何与prestashop wordpress中的重定向相似的模块

+0

的Prestashop有自己的404页 –

+0

是的,我想跟踪导致404页面的原始URL,以便我可以修复它,如果它是一个破损的URL或只是根据需要设置301重定向。 – viggy

回答

1

在/清除/控制器/正面/ 创建一个名为:

PageNotFoundController.php

我们进入:

class PageNotFoundController extends PageNotFoundControllerCore 
    { 

    public function initContent() 
    { 
     $url ="new path to redirect"; 
     header('HTTP/1.1 301 Moved Permanently'); 
     header('Location: '.$url; 
     ob_end_flush(); 
     exit; 
    } 
} 

删除缓存/ class_index.php