2016-07-25 5 views
1

私はLaravel 5プロジェクトを持っています。スタッフの情報はtesting.com/staffsからアクセスできますが、URLをtesting.com/test/index.php/staffsに変更したいのですが、 "test/index.php /"を使ってLaravel Routeグループを試しましたが、laravelは "dot"をルートでサポートしていませんでした。どうすればいいですか?Nginx Laravel Codeigniterとしてのルート

次は私がリカード・スミスは右のかもしれないと思うnginx.conf

location/{ 
     try_files $uri $uri/ /index.php?$args; 

     location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ { 
      expires  max; 
     } 

     location ~ [^/]\.php(/|$) { 
      fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 
      if (!-f $document_root$fastcgi_script_name) { 
       return 404; 
      } 

      fastcgi_pass 127.0.0.1:9006; 
      fastcgi_index index.php; 
      include   /etc/nginx/fastcgi_params; 
     } 
    } 
+0

あなたは 'fastcgi_split_path_info ^(。+?\。php)(/.*)$;'が不足しているようです。 [このドキュメント](https://www.nginx.com/resources/wiki/start/topics/examples/phpfcgi/)を参照してください。 –

+0

経路の接頭辞を試しましたか? \t 'ルート::グループ([ 'プレフィックス' => 'テスト/ index.phpを']、関数(){ここで \t \t/*あなたの経路... */ \t});' – shempignon

+0

shempignon。 Laravelはroute :: group接頭辞でドットをサポートしませんでした – Geeks

答えて

0

の私の一部です!次は最終的にコード

location/{ 
     try_files $uri $uri/ /index.php?$query_string; 
    } 

location ~ \.php$ { 
    fastcgi_split_path_info ^(.+\.php)(/.+)$; 
    fastcgi_pass 127.0.0.1:9006; 
    fastcgi_index index.php; 
    include /etc/nginx/fastcgi_params; 
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 

    fastcgi_intercept_errors off; 
    fastcgi_buffer_size 16k; 
    fastcgi_buffers 4 16k; 
    fastcgi_connect_timeout 300; 
    fastcgi_send_timeout 300; 
    fastcgi_read_timeout 300; 
} 

次にあなたは、今、「ドット」と感謝リカード・スミスとshempignonヘルプをルートグループプレフィックスを使用することができます!

関連する問題