Reputation: 690
I recently came across Redirection plugin for wordpress which makes it very easy to capture links which are creating 404 errors and then set 301 redirections for the same. I am looking for something similar for my prestashop site too. Is there any module for prestashop? If not, is there some other way for me to modify the code to track 404 pages or through the apache access/error logs.
Upvotes: 1
Views: 176
Reputation: 1301
In /override/controllers/front/ create a file called: PageNotFoundController.php
we enter:
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;
}
}
delete cache/class_index.php
Upvotes: 1