HELP! Subdomain Laragon

  • | 464 points

    I'm migrating from XAMPP to Laragon, and I'm finding very difficult to configure the virtual hosts due to the little information that there is about it. In XAMPP httpd-vhost.conf I have this

    <VirtualHost *:80>
        UseCanonicalName Off
        ServerName my-app.mv2
        ServerAlias *.my-app.mv2
        VirtualDocumentRoot "M:/webserver/my-app/%1"
        VirtualScriptAlias "M:/webserver/my-app/%1"
        LogLevel debug
        <Directory "M:/webserver/my-app">
            Options Indexes FollowSymLinks
            AllowOverride All
            Order Allow,Deny
            Allow from all
            Require local

    So I can access to my project structure using the next subdomains:

        +---v1 =
        +---v2 =
        +---en =

    But I can't find the way to get this by editing the file M:\laragon\etc\apache2\sites-enabled\my-app.

    define ROOT "M:/webserver/my-app/"
    define SITE "my-app.local"
    <VirtualHost *:80>
        DocumentRoot "${ROOT}"
        ServerName ${SITE}
        ServerAlias *.${SITE}
        <Directory "${ROOT}">
            AllowOverride All
            Require all granted

    All the subdomain open the main domain.

  • administrators
    | 132772 points

    @mv2_laragon : Please update the Virtual Host template file in C:/laragon/bin/laragon/tpl

    The update will keep permanently when generating virtual hosts.

    For the auto generated virtual host file, if you want Laragon to respect your changes - remove the auto. prefix.

  • | 464 points

    Thanks for replying, I found my mistake, I forgot to enable in laragon\bin\apache\[version]\conf\httpd.conf that's why VirtualDocumentRoot wasn't a valid directive. Thanks anyway

Log in to reply

Looks like your connection to Laragon was lost, please wait while we try to reconnect.