0
我從一臺服務器遷移到另一個一個CakePHP的應用程序,但在新服務器上運行給出了這樣的錯誤,請記住,在ITA是語言路線,URL中看起來是這樣 http://www.c2cistanbul.com/ita/post/263CakePHP的缺失控制器語言路線
控制器丟失 錯誤:無法找到ItaController。 錯誤:在文件中創建類ItaController如下:應用程序/控制器/ ita_controller.php
<?php
class ItaController extends AppController {
var $name = 'Ita';
}
?>
注意:如果你想定製此錯誤消息,在app/views /錯誤/ missing_controller.ctp
路線
Router::connect('/pages/*', array('controller' => 'pages', 'action' => 'display'));
$par = Router::parse(substr($_SERVER['REQUEST_URI'],6));
Router::reload();
Router::connect('/', array('controller' => 'site', 'action' => 'home','ita'));
Router::connect('/admin', array('controller' => 'utente', 'action' => 'logged'));
$url = array('home');
if (in_array($par['controller'],$url))
{
Router::connect($par['controller'].'/*/', array('controller' => 'site','action' => $par['controller']));
}
$lang = array('ita', 'eng', 'deu', 'rus','fra');
if (in_array($par['controller'], $lang)){
Router::connect('/ita/_(.*)', array('controller' => 'site', 'action' => 'stdpage','ita',$par['action'],));
Router::connect('/eng/_(.*)', array('controller' => 'site', 'action' => 'stdpage','eng',$par['action']));
Router::connect('/fra/_(.*)', array('controller' => 'site', 'action' => 'stdpage','fra',$par['action']));
Router::connect('/rus/_(.*)', array('controller' => 'site', 'action' => 'stdpage','rus',$par['action']));
Router::connect('/ita/', array('controller' => 'site','action' => 'home','ita'));
Router::connect('/eng/', array('controller' => 'site','action' => 'home','eng'));
Router::connect('/fra/', array('controller' => 'site','action' => 'home','fra'));
Router::connect('/rus/', array('controller' => 'site','action' => 'home','rus'));
Router::connect('/ita/'.$par['action'].'/*/', array('controller' => 'site','action' => $par['action'],'ita'));
Router::connect('/eng/'.$par['action'].'/*/', array('controller' => 'site','action' => $par['action'],'eng'));
Router::connect('/fra/'.$par['action'].'/*/', array('controller' => 'site','action' => $par['action'],'fra'));
Router::connect('/rus/'.$par['action'].'/*/', array('controller' => 'site','action' => $par['action'],'rus'));
您的路線和配置文件是否全部正確複製? – jimiyash 2013-02-28 20:46:42
請張貼您的路線 – Dave 2013-02-28 21:06:25
您要麼丟失路線*,要麼*舊的服務器在.htaccess或apache virtualHost配置中包含特殊的mod_rewrite規則。如果您仍然可以訪問舊服務器上的這些服務器,請在此處查看 – thaJeztah 2013-02-28 23:47:38