<VirtualHost *:80>
ServerName martinwurm.photo
ServerAlias www.martinwurm.photo
ServerAdmin webmaster@martinwurm.photo
VirtualDocumentRoot /usr/share/wordpress
Alias /wp-content /var/lib/wordpress/wp-content
<Directory /usr/share/wordpress>
Options FollowSymLinks
AllowOverride Limit Options FileInfo
DirectoryIndex index.php
Require all granted
</Directory>
<Directory /var/lib/wordpress/wp-content>
Options FollowSymLinks
Require all granted
</Directory>
RewriteEngine On
RewriteRule ^/wp-content/(.*)$ /srv/www/wp-content/%{HTTP_HOST}/$1
RewriteRule ^index\.php$ - [L]
RewriteCond /usr/share/wordpress%{REQUEST_URI} !-f
RewriteCond /usr/share/wordpress%{REQUEST_URI} !-d
RewriteRule . /usr/share/wordpress/index.php [L]
# Also needed if using PHP-FPM / Fast-CGI
RewriteCond %{REQUEST_URI} !^/php5-fcgi/*
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
2 Likes