ホームページ  >  記事  >  バックエンド開発  >  laravel子域名无法直接访问

laravel子域名无法直接访问

WBOY
WBOYオリジナル
2016-06-06 20:16:061039ブラウズ

Route::get('/', function () {

<code>return view('home.welcome');</code>

});
Route::group(['domain' => 'dashboard.homestead.app'], function () {

<code>Route::get('/', function () {
     return 'hello,world!';
});</code>

});
已经在homestead和hosts里配置了dashboard.homestead.app。但是当访问dashboard.homestead.app显示的仍然是上面路由的的内容(home.welcome).
但是如果写成这样
Route::group(['domain' => 'dashboard.homestead.app'], function () {

<code>Route::get('/test', function () {
     return 'hello,world!';
});</code>

});
访问dashboard.homestead.app/test是正常显示的hello world.
这是为什么?不能直接访问dashboard.homestead.app得到hello world吗?

回复内容:

Route::get('/', function () {

<code>return view('home.welcome');</code>

});
Route::group(['domain' => 'dashboard.homestead.app'], function () {

<code>Route::get('/', function () {
     return 'hello,world!';
});</code>

});
已经在homestead和hosts里配置了dashboard.homestead.app。但是当访问dashboard.homestead.app显示的仍然是上面路由的的内容(home.welcome).
但是如果写成这样
Route::group(['domain' => 'dashboard.homestead.app'], function () {

<code>Route::get('/test', function () {
     return 'hello,world!';
});</code>

});
访问dashboard.homestead.app/test是正常显示的hello world.
这是为什么?不能直接访问dashboard.homestead.app得到hello world吗?

声明:
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。