Reputation: 898
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
Reputation: 1839
I wish I would have more information but I will do my best.
Laravel needs 2 things from apache
to start working
sudo a2enmod rewrite
.htaccess
enabledYou can do it by editing
/etc/apache2/apache2.conf
and changeAllowOverride None
toAllowOverride 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