2016-01-11 38 views
3

當我進入localhost:3000/admin 網址重定向到localhost:3000/webroot/admin 並顯示錯誤WebrootController沒有發現CakePHP的3:路由器的錯誤,htacess自動重定向Webroot公司/管理/

但我進入localhost:3000/admin/是正確的 路由器

Router::prefix('admin', function ($routes) { 
    //$routes->connect('/:controller/:action/*', ['prefix' => 'admin']); 
    $routes->connect('/', ['controller' => 'admins', 'action' => 'index']); 
    $routes->fallbacks('InflectedRoute'); 
}); 

htacess:

<IfModule mod_rewrite.c> 
    RewriteEngine on 
    RewriteRule ^$ webroot/ [L] 
    RewriteRule (.*) webroot/$1 [L] 

我的項目

enter image description here

+0

你的問題到底是什麼?請點擊問題中的編輯鏈接並添加該信息。 –

+0

謝謝。對不起,因爲我寫英文不好 –

+0

你有沒有把'webroot'定義爲Apache中的實際文檔根目錄?我對這個問題有些困惑。 – Sevvlor

回答

0

刪除或更改文件夾中的webroot

名admin它可能是一個CakePHP的錯誤。