Answer the question
In order to leave comments, you need to log in
How to route subdomains in Laravel?
Hello.
I am learning Laravel and need to implement subdomain functionality. That is, so that when you go to the url subdomain1.learn.loc, the page displays: "This is Subdomain1"
Work on Open Server, the learn.loc folder is created
Base .htaccess file
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*)$ public/$1 [L]
</IfModule>
Route::group(['domain' => '{subdomain}./learn.loc'], function(){
return 'This is {subdomain}';
});
Answer the question
In order to leave comments, you need to log in
https://laravel.com/docs/5.6/installation#pretty-urls
What is / doing here?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question