Answer the question
In order to leave comments, you need to log in
Apache2 virtualhost use dynamic subdomain as variable?
I need to get the name of the dynamic subdomain in a variable so that I can insert its name into the path.
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName projects.dev
ServerAlias *.projects.dev
VirtualDocumentRoot /mnt/hgfs/Ubuntu/public_html/projects/projects.dev/%1/html
<Directory />
Options FollowSymLinks
AllowOverride all
Require all denied
</Directory>
<Directory /mnt/hgfs/Ubuntu/public_html/projects/projects.dev/*/html>
Options Indexes FollowSymLinks MultiViews
AllowOverride all
DirectoryIndex index.php
Require all granted
</Directory>
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
#CustomLog /mnt/hgfs/Ubuntu/public_html/projects/projects.dev/logs/access.log combined
#ErrorLog /mnt/hgfs/Ubuntu/public_html/projects/projects.dev/logs/error.log
#php_flag log_errors on
#php_value error_log /mnt/hgfs/Ubuntu/public_html/projects/projects.dev/%-3/logs/php_error.log
#php_admin_value upload_tmp_dir /mnt/hgfs/Ubuntu/public_html/projects/projects.dev/%-3/tmp
</VirtualHost>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question