我從github,Laravel 5.2版下載了CMS項目。我在該文件夾中安裝了作曲家,並在.env文件中更改數據庫信息,並且項目工作正常。沒有頁面可用 - Laravel 5.2
但只有回家路線工作時,路線給其餘我「哎呀無頁avaible」
葉片文件只罰款不工作的路線!
<?php
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
Route::get('/', function() {
return view('welcome');
});
Route::auth();
Route::get('/home', '[email protected]');
Route::get('/post/{id}', ['as' => 'home.post', 'uses' => '[email protected]']);
Route::group(['middleware' => 'admin'], function() {
Route::get('/admin', ['as' => 'admin.index', function() {
return view('admin.index');
}]);
Route::resource('admin/users', 'AdminUsersController');
Route::resource('admin/posts', 'AdminPostsController');
Route::resource('admin/categories', 'AdminCategoriesController');
Route::resource('admin/medias', 'AdminMediasController');
Route::resource('admin/comments', 'PostCommentsController');
Route::resource('admin/comment/replies', 'CommentRepliesController');
});
Route::group(['middleware' => 'auth'], function() {
Route::post('comment/reply', '[email protected]');
});
這裏是.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>
是否已打開URL重寫? – Neabfi
@Neabfi是的,我在問題中添加了我的.htaccess文件 –
@hesham:檢查我的*更新*從答覆希望這可以解決您的問題。 –