I've created a dynamic virtual host using this configuration file:
UseCanonicalName Off
<VirtualHost *:80>
ServerName %1.dev
ServerAlias *.%1.dev
ServerAdmin daniel@localhost
VirtualDocumentRoot /home/daniel/public_html/%1
LogLevel error rewrite:trace8 proxy:trace2
ErrorLog /home/daniel/public_html/error.log
CustomLog /home/daniel/public_html/access.log combined
<Directory ~ "/home/daniel/public_html/.*">
Options Indexes FollowSymlinks Multiviews
AllowOverride All
Require all granted
DirectoryIndex index.php index.html
RewriteEngine On
<FilesMatch "\.php$">
SetHandler "proxy:unix:/run/php/php7.0-fpm.sock|fcgi://localhost:9000"
</FilesMatch>
</Directory>
</VirtualHost>
This works fine with php scripts, but I can't make it work with SEF URLs such as those used by WordPress (e.g. http//mysite.dev/blog return 404).
Any ideas on this?