Symfony\Component\Httpkernel\Exception\
Notfoundhttpexception Laravel

Symfony\Component\HttpKernel\Exception\
NotFoundHttpException Laravel

A NotFoundHttpException exception in Laravel always means that it was not able to find a router for a particular URL. And in your case this is probably a problem in your web server configuration, virtual host (site) configuratio, or .htaccess configuration.

Your public/.htaccess should look like this:

<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>

As you can see there is a condition in the first line IfModule mod_rewrite.c, so if you don`t have mode_rewrite installed or enabled, all rewrite rules will fail and this

localhost/Test/public/

Will work fine, but not this:

localhost/Test/public/test

In other hand, this one should work too, because this is its raw form:

localhost/Test/public/index.php/test

Because Laravel needs it to be rewritten to work.

And note that you should not be using /public, your URLs should look like this:

localhost/Test/

This is another clue that your virtual host's document root is not properly configured or not pointing to /var/www/Test/public, or whatever path your application is in.

All this assuming you are using Apache 2.

Laravel error 8 Symfony\Component\HttpKernel\Exception\
NotFoundHttpException

As per the documentation, the routes defined in the routes/api.php file are reachable by prepending api before the URL, therefore, the axios.defaults.baseURL should be http://localhost:8000/api.

Laravel 5 Symfony\Component\HttpKernel\Exception\
NotFoundHttpException: POST http://localhost/myproject/public/leads

I solved it. I change to config\app.php file

'url' =>'http://localhost/myscript_addres/public',

To

'url' =>'http://localhost/',

Laravel error Symfony \ Component \ HttpKernel \ Exception \
NotFoundHttpException

Actually you should use (Remove $ from {$slug}):

Route::get('/posts/{slug}', array(
'as' => 'post-show',
'uses' => 'PostController@getShow'
));

Also change:

<a href="{{ URL::action('post-show', $post->slug) }}">Read more →</a>

To this:

<a href="{{ URL::route('post-show', $post->slug) }}">Read more →</a>

Or use route helper function:

<a href="{{ route('post-show', $post->slug) }}">Read more →</a>

Symfony\Component\HttpKernel\Exception\
NotFoundHttpException

Change your environment file to fix this problem

Previously

APP_URL=localhost

Changed it to

APP_URL=http://localhost


Related Topics



Leave a reply



Submit