Home > Backend Development > PHP Tutorial > laravel子域名无法直接访问

laravel子域名无法直接访问

WBOY
Release: 2016-06-06 20:16:06
Original
1087 people have browsed it

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

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

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

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

});
已经在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>
Copy after login
Copy after login

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

回复内容:

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

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

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

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

});
已经在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>
Copy after login
Copy after login

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

Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template