laravel5框架网站安装到服务器后台界面显示,但是登录不进去,其他页面都是404,目前服务器环境:nginx/1.4.4 、mysql5.6.21、PHP5.6.22;
.env如下:
APP_ENV=local APP_DEBUG=true APP_KEY=Wknod8gk0jUUTTSz3QgbgwgVBmN9afA3 DB_HOST=127.0.0.1 DB_DATABASE=test DB_USERNAME=root DB_PASSWORD=***** CACHE_DRIVER=file SESSION_DRIVER=file QUEUE_DRIVER=sync MAIL_DRIVER=smtp MAIL_HOST=mailtrap.io MAIL_PORT=2525 MAIL_USERNAME=null MAIL_PASSWORD=null MAIL_ENCRYPTION=null
.htaccess如下:
<IfModule mod_rewrite.c> <IfModule mod_negotiation.c> Options -MultiViews </IfModule> RewriteEngine On # Redirect Trailing Slashes... RewriteRule ^(.*)/$ /$1 [L,R=301] # Handle Front Controller... RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] </IfModule>
nginx.conf:
server { listen 80; server_name ***.com; index index.html index.htm index.php; root /alidata/www/test/public; try_files $uri $uri/ @rewrite; location @rewrite { rewrite ^/(.*)$ /index.php?_url=/$1; } location ~ .*\.(php|php5)?$ { #fastcgi_pass unix:/tmp/php-cgi.sock; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi.conf; } location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ { expires 30d; } location ~ .*\.(js|css)?$ { expires 1h; } include /alidata/server/nginx/conf/rewrite/test.conf; access_log /alidata/log/nginx/access/test.log; if (-f $request_filename/index.html){ rewrite (.*) $1/index.html break; } if (-f $request_filename/index.php){ rewrite (.*) $1/index.php; } if (!-f $request_filename){ rewrite (.*) /index.php; } }
求大神帮忙看看那里没对,O(∩_∩)O谢谢
第一种、把域名解析到public目录为根目录
第二种、复制puablic 的.htaccess 到根目录下
另,重新artisan 生成 APP_KEY 必须