How to make a subdomain with laragon
-
hello, i was wondering if you could teach me on how to create a subdomain on laragon. because on my main root folder, i install a cms, and on my subdomain, i want to install another cms, such as a forum cms
-
It's been 3 days since I started with Laragon, but with what experience I got with it I can say that:
-
Ensure that Auto virtual hosts is on.
-
Say you have your main domain as domain.dev, then you should create a folder named domain in the root {LaragonRoot}/www directory.
-
Let's say that you want your subdomain as sub.domain.dev, you should create a folder named sub.domain in the root {LaragonRoot}/www directory.
-
Now, reload Apache/Nginx or stop & restart the Laragon services.
I have not tested this but it may work for you.
-
-
@bantya Worked like a charm. Thx!
-
@bantya
If after this steps your subdomain redirects you to the main domain, you may want to comment the
ServerAlias *.${SITE}
line in theauto.domain.conf
file and removeauto.
prefix (to getdomain.conf
file) so the Laragon do not overwrite your changes, or you can edit the{LARAGON_ROOT}\usr\tpl\VirtualHost.tpl
template file to apply it for all domains automatically.