Sizuji
Sizuji

Reputation: 898

Error "Sorry, the page you are looking for could not be found." Laravel 5.5

Trying to recover laravel application. Can't access any route, everywhere error "Sorry, the page you are looking for could not be found."

My web.php

Route::get('/', 'IndexController@getIndex');

Route::get('/posts', 'IndexController@getPosts');

Route::get('/posts/{id}', 'IndexController@getPost');

Route::get('/posts/category/{id}', 'IndexController@getPostCategory');

Route::get('/reviews', 'IndexController@getReviews');

Route::get('/pages/{id}', 'IndexController@getPage');

Route::get('/contacts', 'IndexController@getContacts');

Route::post('/request', 'IndexController@postRequest');

Auth::routes();

Route::get('/admin', 'HomeController@index');

Route::group(['prefix' => 'admin', 'middleware' => 'auth'], function()
{
    Route::resource('settings', 'SettingController');

    Route::resource('products', 'ProductController');

    Route::resource('data', 'DataController');

    Route::resource('reviews', 'ReviewController');

    Route::resource('posts', 'PostController');

    Route::resource('pages', 'PageController');
});

All controllers and views exist. Apache DocumentRoot is /public/ directory. Standard laravel .htaccess.

Upvotes: 1

Views: 2015

Answers (1)

Cybersupernova
Cybersupernova

Reputation: 1839

I wish I would have more information but I will do my best.

Laravel needs 2 things from apache to start working

  1. rewrite enabled sudo a2enmod rewrite
  2. .htaccess enabled

You can do it by editing /etc/apache2/apache2.conf and change AllowOverride None to AllowOverride All. This should be done for /var/www (the default DocumentRoot for apache)

After doing this use php artisan serve to start a PHP server.

Upvotes: 1

Related Questions