Symfony\Component\HttpKernel\Exception\NotFoundHttpException Laravel

前端 未结 9 1410
情话喂你
情话喂你 2020-12-01 04:37

I am trying to use RESTful controller. Here is my Route.php:

Route::resource(\'test\', \'TestController\');
Route::get(\'/\', function()
{
    r         


        
9条回答
  •  离开以前
    2020-12-01 05:11

    Put this in root .htaccess file

    The below code do three things :

    1. Remove index.php from url .
    2. Remove public from url .
    3. fix your problem .

    Note : RewriteRule ^ index.php [L] this code solve your problem my problem was not added [L] after index.php

    RewriteEngine On
    
     #Session timeout
    
    
        Options -MultiViews
    
    
       Options +FollowSymlinks
       RewriteEngine On
    
       # Redirect Trailing Slashes...
       RewriteRule ^(.*)/$ /$1 [L,R=301]
    
    RewriteCond %{REQUEST_FILENAME} -d [OR]
    RewriteCond %{REQUEST_FILENAME} -f
    RewriteRule ^ ^$1 [N]
    
    RewriteCond %{REQUEST_URI} (\.\w+$) [NC]
    RewriteRule ^(.*)$ public/$1
    
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
    
    
    
    

提交回复
热议问题