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

The simplest method to configure multiple domain names in laravel

藏色散人
Release: 2021-01-19 09:00:16
forward
3601 people have browsed it

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');
});
Copy after login

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!

Related labels:
source:cnblogs.com
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