Reputation: 256
Crated laravel project using below command
composer create-project --prefer-dist laravel/laravel blog
successfully created blog project "http://localhost/blog/public/" after that added below code in "routes.php" file
Route::get('about', function () {
return view('welcome');
});
but after that when i type "http://localhost/blog/public/about" its displaying 404 page.
if anyone have any idea please share with me
Upvotes: 0
Views: 1284
Reputation: 21
Try to put .htaccess file to Your laravel home directory. It seems, You need .htaccess with next content:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*)$ blog/public/$1 [L]
</IfModule>
Surely, your apache mod_rewrite have to be enabled.
Upvotes: 2
Reputation: 11677
Well I don't know how you serve the application, apache, nginx or php simple serving.
Lets start from here:
Upvotes: 3
Reputation: 1615
It seems like you are missing about.blade.php
view for your about
action.
Also check that are you getting control inside about route using below code snippet.
Route::get('about', function () {
$testVar = "Demo data";
return $testVar;
});
Upvotes: 0