Ok I'm new to Laravel so went straight to the documentation to get started. There are massive holes in the documentation so it took a lot of effort and googling to fill the gaps in order to get Laravel set-up. I now have it set up and moved on to the next step in the quick start guide.I created my route
Route::get('users', function()
{
return 'Users!';
});
Now it says:
Now, if you hit the /users route in your web browser, you should see Users!
So I hit up:
http://localhost/laravel/users
but get a 404? I tried
http://localhost/laravel/public/users
but still a 404? I followed the steps on the quick start guide to the letter, what am I missing?
Apache isn't probably reading the public/.htaccess file due to the directive AllowOverride being set to None. Try to set it to All.
Laravel 4 simple route not working using mod_rewrite, and .htaccess
I know this question is 4 years old but still it have its significance.Rubens Mariuzzo was answered it correctly but I want to add some points on it. You said
"There are massive holes in the documentation so it took a lot of effort and googling to fill the gaps in order to get Laravel set-up"
For beginners it is difficult to find correct way of configuring Laravel. Once it is mastered it is fun developing Laravel :) . There are certain correct way of doing this.
Detailed description is given in this blog http://masterlaravel.blogspot.in/2017/08/laravelquick-start-composer-create.html
Seems like your Laravel app is accesible via an Apache HTTP alias, because your URL looks like:
http://localhost/laravel/
. If this is the case and assuming thathttp://localhost/laravel
is pointing to your public directory, then follow these steps:/index.php/
, in your case:http://localhost/laravel/index.php/users
. If it works (no 404) then you problem is with the Rewrite Module configuration of Apache HTTP, you should follow the next steps.public/.htaccess
.RewriteEngine On
addRewriteBase /laravel/
.Basically, if you app resides in a alias or virtual directory (say
http://localhost/alias
) you should add an entry in your rewrite rule to rewrite the base directory withalias
.