Thomas Kaemmerling
Thomas Kaemmerling

Reputation: 547

Laravel 5 NotFoundHttpException in RouteCollection

I have the follwing routs defined in routs.php:

Route::get('/',"TodoListController@index" );

Route::get('/todos',"TodoListController@index" );

Route::resource('/', 'TodoListController');

but only the first one work. I use xampp to develop my Laravel app. This is the url that work: http://localhost/restapp/public/ and that don't work:http://localhost/restapp/public/todos

Thanks for help

Upvotes: 1

Views: 278

Answers (1)

Emeka Mbah
Emeka Mbah

Reputation: 17553

To remove public from your URL add

<IfModule mod_rewrite.c> 
    RewriteEngine On RewriteRule ^(.*)$ 
    public/$1 [L] 
</IfModule> 

to your .htaccess

or You can forget XAMPP and use:

php artisan serve

Upvotes: 1

Related Questions