0

Is it possible to create a VirtualHost entry for a ServerName that's a folder directory rather than a complete domain?

I'm installing Craft 3 and want to run it from my current VirtualHost (rich.dev) but it requires a separate DocumentRoot (/web) thus I have to set it up as a separate VH.

<VirtualHost *:443>
    DocumentRoot "/var/www/html"
    ServerName rich.dev
    SSLEngine on
    SSLCertificateFile "/etc/apache2/ssl/rich.dev.crt"
    SSLCertificateKeyFile "/etc/apache2/ssl/rich.dev.key"
</VirtualHost>

<VirtualHost *:80>
    DocumentRoot "/var/www/html/craft/web"
    ServerName craft.rich.dev
    <Directory /var/www/html/craft/>
        Options FollowSymlinks
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>

I want to use the SSL cert and ServerName of rich.dev so ideally I could visit rich.dev/craft/ and it would load rather than having to use craft.rich.dev and set up an SSL key every time I add a new Craft instance.

Thoughts?

0 Answers0