2016-07-27 248 views
0

在文件routes.php文件Laravel 5.2路由失败

当我有:

Route::get('/', ['uses' => '[email protected]']); 

它与URL http://localhost/adhesion/public/

,但是当我有

Route::get('/adherer', ['uses' => '[email protected]']); 

或 Route :: get('adherer',['uses'=>'AdhererController @ show']);

它不工作对URL

的错误是:

未找到

在此 服务器上没有找到请求的URL/adhesion/public/adherer。 Apache/2.4.7(Ubuntu)服务器在本地端口80端口80

怎么了?

非常感谢您的帮助!

+0

只尝试'adherer' insted的'的使用adherer/adherer' –

+0

同样的错误.. – ratm

+0

好像你误解了路由的感觉。 – rmondesilva

回答

0

您的网址改成这样,删除public

/adhesion/adherer 

/adhesion/public/adherer 
0

在文件:.ENV,修改APP_URL到:

APP_URL=.. 

试试这个:

Route::get('adherer', '[email protected]'); 

测试:http://localhost/adhesion/public/adherer

顺便说一句,你可以创建Apache的配置,以解决您的问题:

Alias /your_project /var/www/html/your_project/public/ 
<Directory "/var/www/html/your_project/public"> 
     AllowOverride All 
     Order allow,deny 
     allow from all 
</Directory>