下面是我面临的Laravel-5.4 代码。我创建了测试 Laravel 项目,用两页五十英镑的家庭 & ,用 Apache v-host(www.test.com) 对文件路径进行了
如果你在 www.test.com www.test.com/index.php/about know know know know know know
控制器:
public function index(){
return view('pages.index');
}
public function about(){
return view('pages.about');
}
路由:
//Home Page
Route::get('/','pagesController@index');
//About Us Page
Route::get('/about','pagesController@about');
:
ServerAdmin webmaster@localhost
ServerName test.com
ServerAlias www.test.com
DocumentRoot/var/www/html/test/public/
。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>