Pretty URLs
Apache
The framework ships with a public/.htaccess file that is used to allow URLs without index.php. If you use Apache to serve your Laravel application, be sure to enable the mod_rewrite module.
If the .htaccess file that ships with Laravel does not work with your Apache installation, try this one:
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
nginx的配置问题,你这种情况应该是看一下你的nginx的server模块 index 有没有index.php , 然后再看下nginx有没有配置处理PHP文件的php-fpm
详细参考:
https://laravel.com/docs/5.1
首先你看看你是否是通过HTTP协议进行访问的,出现这种情况一般都是通过file:协议进行访问出现的现象。
谢谢各位回答,的确是服务器这边的问题,Gundy的答案是Nginx的处理方法.我的是apache服务器,下面这段是百度的结果
Apache目录下,有一个conf目录,打开里面的"httpd.conf"文件,找到 DirectoryIndex 这段.把它改成DirectoryIndex index.php index.Html index.html 这样,你的网站目录的默认首页是 index.php, 如果没有index.php系统会自动寻找index.html、html做为默认首页了。