1. 程式人生 > >laravel配置路由除了\都是404

laravel配置路由除了\都是404

大概是路由,重寫,專案根目錄配置有關

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