我不知道exacly的Prestashop但我知道你有类似类:
class PageNotFoundControllerCore extends FrontController
{
public $php_self = 'pagenotfound';
public $page_name = 'pagenotfound';
public $ssl = true;
/**
* Assign template vars related to page content.
*
* @see FrontController::initContent()
*/
public function initContent()
{
header("Location: index.php") // delete everything here and add this line.
}
也许它存储有:
的PrestaShop /控制器/前/ PageNotFoundController.php GitHub
正如你所看到的,你可以在那里添加header("Location index.php")
。在地方"Location <redirect_location>"
你可以写你想要重定向的地方。更多信息可以在PHP Manual: header
你在你的'.htaccess'像'的ErrorDocument 404写/ index.php'?你试过'<?php header(“Location:index.php”);?>'? –
哪里?在.htacess中? – bloodstriker
.htacess中的php代码?这可能吗? – bloodstriker