I\'ve just started learning the Laravel framework and I\'m having an issue with routing.
The only route that\'s working is the default home route that\'s attached to
I was getting the same problem using EasyPHP. Found that I had to specify AllowOverride All
in my <Directory>
block in httpd.conf
. Without this, Apache sometimes ignores your .htaccess
.
Mine ended up looking like this...
<Directory "D:/Dev">
Options FollowSymLinks Indexes
#### NEXT IS THE CRUCIAL LINE ####
AllowOverride All
Order deny,allow
Allow from 127.0.0.1
Deny from all
Require all granted
</Directory>
Just Run in your terminal.
composer dump-autoload
index.html
.htaccess
sudo service apache2 restart
most probably it's due to cache problems
On my Ubuntu LAMP installation, I solved this problem with the following 2 changes.
sudo a2enmod rewrite
.AllowOverride All
Then restart the Apache server: service apache2 restart
Route::get('/', function()
{
return View::make('home.index');
});
Route::get('user', function()
{
return View::make('user.index');
});
change above to
Route::get('user', function()
{
return View::make('user.index');
});
Route::get('/', function()
{
return View::make('home.index');
});
You have to use '/'(home/default) at the end in your routes
Don't forget the "RewriteBase
" in your public/.htaccess
:
For example :
Options +FollowSymLinks
RewriteEngine On
RewriteBase /your/folder/public