Use subdomain with Laravel and Directadmin

rkytie

New member
Joined
Apr 8, 2020
Messages
1
Hello.

I have a Laravel project and i want subdomain on this project.

I create subdomain and i add this route;

Route::domain('subdomain.mysite.com')->group(function () {
Route::get('/', '[email protected]')->name('name');
});

but... i have a problem. Its opening default page, i dont see my view.

How can i do?

I dont know enough level English btw. If u dont understand, i will can write better than.
 

Keizan

New member
Joined
Apr 12, 2020
Messages
2
You have to set the root of your subdomain to the public folder of your Laravel project.
 

GR_

Verified User
Joined
Nov 13, 2008
Messages
22
hello . please help me . i have same problem . i need to set subdomain point to root (laravel app) , after search in web i find bellow link but it explan for one subdomain i need set root any subdomain to root https://help.directadmin.com/item.php?id=199
The very easy way is to install your Laravel project, lets say in:
/home/DOMAIN_USER/domains/YOUR_DOMAIN/web/
directory, alongside with
/home/DOMAIN_USER/domains/YOUR_DOMAIN/pulic_html/
directory and then just simply point
/home/DOMAIN_USER/domains/YOUR_DOMAIN/pulic_html/
as an alias to
/home/DOMAIN_USER/domains/YOUR_DOMAIN/web/public
via next command line:
ln -s /home/DOMAIN_USER/domains/YOUR_DOMAIN/web/public /home/DOMAIN_USER/domains/YOUR_DOMAIN/public_html

P.S. in `ln` use full paths!!! Not relative paths, otherwise you'll have problems with SSL.
 

ish

New member
Joined
Nov 27, 2021
Messages
4
h
Hello.

I have a Laravel project and i want subdomain on this project.

I create subdomain and i add this route;

Route::domain('subdomain.mysite.com')->group(function () {
Route::get('/', '[email protected]')->name('name');
});

but... i have a problem. Its opening default page, i dont see my view.

How can i do?

I dont know enough level English btw. If u dont understand, i will can write better than.
ow you fix it bro same problem here
 
Top