简体   繁体   English

使用Laravel 4发现404错误

[英]404 error found using Laravel 4

I have created application in Laravel 4. It's giving URL problems. 我已经在Laravel 4中创建了应用程序。这给URL问题带来了麻烦。 For example: if I used http://example.com/login , it's displaying a 404 error. 例如:如果我使用http://example.com/login ,它将显示404错误。

But if I used http://example.com/index.php/login , it's displaying without any error. 但是,如果我使用http://example.com/index.php/login ,则显示时没有任何错误。

I want to use URL without index.php in that because by adding index.php in URL, CSS and JS files are not including in the page. 我要使用没有index.php URL,因为通过在URL中添加index.php ,页面中不包括CSS和JS文件。

the problem probably in your server configuration or .htaccess 问题可能出在您的服务器配置或.htaccess中

I've just encountered the same problem, for me enabling mod_rewrite for apache2 fix it. 我刚刚遇到了同样的问题,因为我为apache2启用了mod_rewrite来解决它。

You should probably read: 您可能应该阅读:

https://laravel.com/docs/5.0/configuration#pretty-urls https://laravel.com/docs/5.0/configuration#pretty-urls

Can't route properly in Laravel 在Laravel中无法正确路由

Can't access URL in Laravel routes 无法访问Laravel路由中的URL

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM