当前位置:网站首页>Laravel subdomain accesses different routing files and different modules

Laravel subdomain accesses different routing files and different modules

2022-06-26 12:23:00 Yotoai Mengtian

    To make laravel Access the customized routing file , You can use the following methods :

        1、 First in cmd Use in window Command to create a routing file :  type nul > blog.php

        2、 stay  App\Providers\RouteServiceProvider   Modify the , Pictured :

            

        3、 establish Blog modular , Use laravel command :php artisan make:controller Blog/IndexController , That's right. app/http/Controllers/ I created Blog modular .

        4、 stay blog.php Add the following code to :

         

        5、 To configure windows Of hosts file add to :127.0.0.1     blog.mtblog.com

             nginx Middle configuration vhost Use this domain name to point to your project directory

              And then visit  blog.mtblog.com , As shown in the figure :

            

原网站

版权声明
本文为[Yotoai Mengtian]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202170520382356.html