大概是路由,重写,项目根目录配置有关
1:nginx配置
server {
listen 80;
server_name 127.0.0.1 alias www.lal.com;
location / {
root E:\www\monitor\laravel\public;
index index.html index.htm default.html default.htm index.php server.php default.php app.php u.php;
include E:\www\UPUPW_NP5.6-1511\UPUPW_NP5.6\htdocs\up-rewrite.conf;
}
autoindex off;
include advanced_settings.conf;
#include expires.conf;
location ~* .*\/(attachment|attachments|uploadfiles|avatar)\/.*\.(php|php5|phps|asp|aspx|jsp)$ {
deny all;
}
location ~ ^.+\.php {
root E:\www\monitor\laravel\public; //重点
fastcgi_pass bakend;
fastcgi_index index.php;
fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
include fastcgi.conf;
}
}
2:项目根目录添加 .htaccess
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
</IfModule>
3.如果是apache需要开启rewrite
4. php开启phpopenssl