Home  >  Article  >  PHP Framework  >  The simplest method to configure multiple domain names in laravel

The simplest method to configure multiple domain names in laravel

藏色散人
藏色散人forward
2021-01-18 15:01:363464browse

The following column Laravel Tutorial will introduce you to the simplest method of configuring multiple domain names in laravel. I hope it will be helpful to friends in need!

The simplest method to configure multiple domain names in laravel

The easiest way to configure multiple domain names in laravel

web.php

Route::group(['domain' => 'www.a.com'], function () {
Route::any('/','\App\Http\Controllers\IndexController@index');
});
Route::group(['domain' => 'www.b.cn'], function () {
Route::any('/','\App\Http\Controllers\IndexController@home');
});

More related technical articles , please visit the laravel framework column!

The above is the detailed content of The simplest method to configure multiple domain names in laravel. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:cnblogs.com. If there is any infringement, please contact admin@php.cn delete