Reputation: 547
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
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