我创建了一个laravel项目,我加入到资源/观点:2个叶片,Laravel视图路由
home.blade.php
restaurants.blade.php
在laravel 5.4,我在web.php创建路由
Route::get('/', function() {
return view('home');
});
Route::get('restaurants', function() {
return view('restaurants');
});
当我打开我的项目localhost/food/public 家刀片正在打开。 当我点击的餐馆,将URL更改为:localhost/food/public/restaurants
和给我:
Sorry, the page you are looking for could not be found.
1/1
NotFoundHttpException in RouteCollection.php line 179:
的htaccess:
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule^index.php [L]
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
</IfModule>
查看路线列表'php artisan route:list'并检查您的网页是否存在。 – Webinion
我检查了路由列表,页面出现,我查看了资源视图中的页面,它在那里 –